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

      1. <small id='aKLA8'></small><noframes id='aKLA8'>

        如何在 CodeIgniter 中使用 MySQLi 驱动程序

        时间:2023-07-29
          <tbody id='QaNdp'></tbody>

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

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

                  本文介绍了如何在 CodeIgniter 中使用 MySQLi 驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如何在 PHP 原生查询中使用 mysqli 驱动程序?

                  How can I use mysqli drivers in PHP native query?

                  例如.我的代码:

                  型号

                  class Home_model extends CI_Model{
                      public function getusers(){
                          $q = "SELECT * FROM `users`";
                          return $r = mysqli_query($q);
                      }
                  }
                  

                  控制器:

                  class Home extends CI_Controller{
                      public function iterateuser(){
                          while($row = mysqli_fetch_object($this->Home_model->getusers())) {
                              echo $row->username;
                          }
                      }
                  

                  我上面的代码有一个错误,说:

                  My code above has an error, saying:

                  mysqli_query 需要至少 2 个参数

                  mysqli_query expects at least 2 parameters

                  CodeIgniter 中是否有一种方法可以传递 mysqli_query() 第一个参数上的链接,如 php.net 文档中所述http://php.net/manual/en/mysqli.query.php

                  Is there a way in CodeIgniter to pass the link on the mysqli_query() first parameter as described on the php.net documentation http://php.net/manual/en/mysqli.query.php

                  推荐答案

                  转到:

                  yourproject/application/config/database.php
                  

                  变化:

                  $db['default']['dbdriver'] = 'mysql';   
                  

                  与:

                  $db['default']['dbdriver'] = 'mysqli';
                  

                  这篇关于如何在 CodeIgniter 中使用 MySQLi 驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:mysqli_real_escape_string 和准备好的语句? 下一篇:PHP mysqli_fetch_field 数据类型

                  相关文章

                  最新文章

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

                      <small id='8dgor'></small><noframes id='8dgor'>

                        <bdo id='8dgor'></bdo><ul id='8dgor'></ul>

                      <tfoot id='8dgor'></tfoot>