<bdo id='AaeEJ'></bdo><ul id='AaeEJ'></ul>
  • <i id='AaeEJ'><tr id='AaeEJ'><dt id='AaeEJ'><q id='AaeEJ'><span id='AaeEJ'><b id='AaeEJ'><form id='AaeEJ'><ins id='AaeEJ'></ins><ul id='AaeEJ'></ul><sub id='AaeEJ'></sub></form><legend id='AaeEJ'></legend><bdo id='AaeEJ'><pre id='AaeEJ'><center id='AaeEJ'></center></pre></bdo></b><th id='AaeEJ'></th></span></q></dt></tr></i><div id='AaeEJ'><tfoot id='AaeEJ'></tfoot><dl id='AaeEJ'><fieldset id='AaeEJ'></fieldset></dl></div>
  • <small id='AaeEJ'></small><noframes id='AaeEJ'>

    1. <legend id='AaeEJ'><style id='AaeEJ'><dir id='AaeEJ'><q id='AaeEJ'></q></dir></style></legend>

        <tfoot id='AaeEJ'></tfoot>
      1. 为什么要使用 mysqli_close()?

        时间:2023-07-30
            <bdo id='hmclq'></bdo><ul id='hmclq'></ul>

            <small id='hmclq'></small><noframes id='hmclq'>

                <tbody id='hmclq'></tbody>
              1. <tfoot id='hmclq'></tfoot>

                • <i id='hmclq'><tr id='hmclq'><dt id='hmclq'><q id='hmclq'><span id='hmclq'><b id='hmclq'><form id='hmclq'><ins id='hmclq'></ins><ul id='hmclq'></ul><sub id='hmclq'></sub></form><legend id='hmclq'></legend><bdo id='hmclq'><pre id='hmclq'><center id='hmclq'></center></pre></bdo></b><th id='hmclq'></th></span></q></dt></tr></i><div id='hmclq'><tfoot id='hmclq'></tfoot><dl id='hmclq'><fieldset id='hmclq'></fieldset></dl></div>
                  <legend id='hmclq'><style id='hmclq'><dir id='hmclq'><q id='hmclq'></q></dir></style></legend>
                  本文介绍了为什么要使用 mysqli_close()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  有什么理由让我在查询之后或脚本结束时关闭连接吗?

                  Is there any reason why I should close the connection after a query or at the end of the script?

                  做/不做有什么好处?

                  推荐答案

                  连接(如果不是持久的) 总是在脚本结束时关闭,所以,理论上,你不会需要自己关闭.

                  The connection (if not persistent) is always closed at the end of the script, so, in theory, you don't need to close it yourself.

                  不过,如果您的 PHP 脚本需要大量时间来执行,那么当您不再需要对数据库执行任何请求时关闭连接是个好主意——至少,如果长时间的计算是在之后完成的查询.

                  Still, if your PHP script takes lots of time to execute, it's a good idea to close the connection when you don't have to do any request to the database anymore -- at least, if the long calculations are done after the queries.

                  如果您的应用程序部署在共享主机上,则尤其如此:您的用户帐户通常只能同时打开几个连接.(在共享主机上,同时打开的连接数量可能很少;在私人服务器上通常更大).

                  This is especially true if your application is deployed on a shared hosting : your user account can generally only have a few connections opened at the same time. (That number of simultaneous opened connections can be pretty small on shared hosting ; it's generally bigger on private servers).


                  我们经常不关闭自己的联系的原因是:


                  The reason we often don't close connections ourselfves is :

                  • 我们通常不知道何时完成了所有查询——对于由许多小块"组成的页面尤其如此;每一个都是独立于其他的,并且可以自己进行查询;那么,我们什么时候可以关闭连接?
                  • 网页的生成速度通常非常快,因此我们不必担心关闭与数据库的连接.

                  这篇关于为什么要使用 mysqli_close()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:mysql &amp; 的区别mysqli 下一篇:刷新 mysqli_multi_query() 的速度/最佳实践

                  相关文章

                  最新文章

                  <legend id='16E0O'><style id='16E0O'><dir id='16E0O'><q id='16E0O'></q></dir></style></legend>

                  <small id='16E0O'></small><noframes id='16E0O'>

                    1. <tfoot id='16E0O'></tfoot>
                    2. <i id='16E0O'><tr id='16E0O'><dt id='16E0O'><q id='16E0O'><span id='16E0O'><b id='16E0O'><form id='16E0O'><ins id='16E0O'></ins><ul id='16E0O'></ul><sub id='16E0O'></sub></form><legend id='16E0O'></legend><bdo id='16E0O'><pre id='16E0O'><center id='16E0O'></center></pre></bdo></b><th id='16E0O'></th></span></q></dt></tr></i><div id='16E0O'><tfoot id='16E0O'></tfoot><dl id='16E0O'><fieldset id='16E0O'></fieldset></dl></div>
                        <bdo id='16E0O'></bdo><ul id='16E0O'></ul>