• <tfoot id='9CUT6'></tfoot>

    <small id='9CUT6'></small><noframes id='9CUT6'>

      1. <legend id='9CUT6'><style id='9CUT6'><dir id='9CUT6'><q id='9CUT6'></q></dir></style></legend>
        <i id='9CUT6'><tr id='9CUT6'><dt id='9CUT6'><q id='9CUT6'><span id='9CUT6'><b id='9CUT6'><form id='9CUT6'><ins id='9CUT6'></ins><ul id='9CUT6'></ul><sub id='9CUT6'></sub></form><legend id='9CUT6'></legend><bdo id='9CUT6'><pre id='9CUT6'><center id='9CUT6'></center></pre></bdo></b><th id='9CUT6'></th></span></q></dt></tr></i><div id='9CUT6'><tfoot id='9CUT6'></tfoot><dl id='9CUT6'><fieldset id='9CUT6'></fieldset></dl></div>

          <bdo id='9CUT6'></bdo><ul id='9CUT6'></ul>

        mysqli、OOP 与程序化

        时间:2023-07-29

                <tbody id='R6C9d'></tbody>

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

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

                  <bdo id='R6C9d'></bdo><ul id='R6C9d'></ul>
                  <tfoot id='R6C9d'></tfoot>
                  <i id='R6C9d'><tr id='R6C9d'><dt id='R6C9d'><q id='R6C9d'><span id='R6C9d'><b id='R6C9d'><form id='R6C9d'><ins id='R6C9d'></ins><ul id='R6C9d'></ul><sub id='R6C9d'></sub></form><legend id='R6C9d'></legend><bdo id='R6C9d'><pre id='R6C9d'><center id='R6C9d'></center></pre></bdo></b><th id='R6C9d'></th></span></q></dt></tr></i><div id='R6C9d'><tfoot id='R6C9d'></tfoot><dl id='R6C9d'><fieldset id='R6C9d'></fieldset></dl></div>
                  本文介绍了mysqli、OOP 与程序化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我第一次看到这个.我不知道你可以通过做类似的事情来实例化一个 mysqli 类

                  I just saw this for the first time. I had no idea you can instantiate a mysqli class by doing something like

                  new mysqli( $host, $username, $password, $db );
                  

                  这对我来说是全新的...连接到数据库时,我在网上或书中看到的每个教程都是这样的:

                  This is brand new to me...Every tutorial I have seen online or in books when connecting to database does something like this:

                  $conn = mysqli_connect( $host, $username, $password, $db );
                  
                  if ( !$conn ) {
                      die( 'Sorry, could not connect');
                  }
                  

                  为什么大多数教程都以程序方式进行操作?即使在我看到的有关创建单独的数据库类的教程中,也告诉我使用程序样式代码...

                  Is there a reason why most tutorials do it the procedural way? Even in tutorials I have seen on creating a separate database class, tell me to use the procedural style code...

                  mysqli procedural vs oop 有什么区别?有没有?我是否必须安装某种扩展,或者我可以开始在我的代码中使用吗?这里完全是新手,所以不太确定.

                  What's the difference with mysqli procedural vs oop? Is there any? Do I have to install any extensions of some kind or can I just start using in my code? Total newb here, so not really sure.

                  另外,什么时候使用 PDO 和 mysqli 比较好?处理大型企业应用程序的开发人员最常使用 PDO 吗?或者只是喜好问题.

                  Also, when is it a good idea to use PDO vs mysqli? Is PDO used most commonly by developers that work on large scale Enterprise applications? Or is simply a matter of preference.

                  感谢您的帮助...

                  学习 php 很快就上瘾了……我只是想知道的越来越多.

                  learning php has quickly become addictive...I just want to know more and more.

                  推荐答案

                  互联网上 99% 的 PHP 教程已经过时,提倡糟糕的代码,或者是由可能不应该教 PHP 的人编写的(通常包括上述所有内容)).您应该找到一些好的.

                  99% of PHP tutorials on the internet are outdated, advocate terrible code or are written by people that probably shouldn't teach PHP (and commonly all of the above). You should find the handful of good ones.

                  PDO 通常比 mysqli 受到开发人员的青睐,包括我.一方面,它可以处理比 MySQL 更多的数据库.

                  PDO is generally favoured over mysqli by developers, including me. For one, it can handle many more databases than just MySQL.

                  这篇关于mysqli、OOP 与程序化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:警告:mysqli_connect():未知的 MySQL 服务器主机 下一篇:绑定布尔值的 bind_param 问题

                  相关文章

                  最新文章

                  <legend id='PwCSW'><style id='PwCSW'><dir id='PwCSW'><q id='PwCSW'></q></dir></style></legend>

                      <bdo id='PwCSW'></bdo><ul id='PwCSW'></ul>

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

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