• <tfoot id='NiGxi'></tfoot>

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

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

      1. mysqli_select_db() 期望参数 1 是 mysqli,给定的字符串

        时间:2023-07-31
      2. <i id='2LxhI'><tr id='2LxhI'><dt id='2LxhI'><q id='2LxhI'><span id='2LxhI'><b id='2LxhI'><form id='2LxhI'><ins id='2LxhI'></ins><ul id='2LxhI'></ul><sub id='2LxhI'></sub></form><legend id='2LxhI'></legend><bdo id='2LxhI'><pre id='2LxhI'><center id='2LxhI'></center></pre></bdo></b><th id='2LxhI'></th></span></q></dt></tr></i><div id='2LxhI'><tfoot id='2LxhI'></tfoot><dl id='2LxhI'><fieldset id='2LxhI'></fieldset></dl></div>

              <bdo id='2LxhI'></bdo><ul id='2LxhI'></ul>
                <tbody id='2LxhI'></tbody>

              <small id='2LxhI'></small><noframes id='2LxhI'>

              <legend id='2LxhI'><style id='2LxhI'><dir id='2LxhI'><q id='2LxhI'></q></dir></style></legend>
              1. <tfoot id='2LxhI'></tfoot>

                  本文介绍了mysqli_select_db() 期望参数 1 是 mysqli,给定的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我是 Mysqli_* 的新手,但出现以下错误:

                  I am new to Mysqli_* and I am getting these errors:

                  警告:mysqli_select_db() 期望参数 1 是 mysqli,字符串在第 11 行的 D:Hosting9864230htmlincludesconnection.php 中给出

                  Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in D:Hosting9864230htmlincludesconnection.php on line 11

                  警告:mysqli_error() 需要 1 个参数,0 给出D:Hosting9864230htmlincludesconnection.php 第 13 行

                  Warning: mysqli_error() expects exactly 1 parameter, 0 given in D:Hosting9864230htmlincludesconnection.php on line 13

                  数据库选择失败:

                  <?php
                  require("constants.php");
                  
                  // 1. Create a database connection
                  $connection = mysqli_connect(DB_SERVER,DB_USER,DB_PASS);
                  if (!$connection) {
                      die("Database connection failed: " . mysqli_error());
                  }
                  
                  // 2. Select a database to use 
                  $db_select = mysqli_select_db(DB_NAME,$connection);
                  if (!$db_select) {
                      die("Database selection failed: " . mysqli_error());
                  }
                  ?>
                  

                  推荐答案

                  您的论点顺序错误.根据 docs

                  Your arguments are in the wrong order. The connection comes first according to the docs

                  <?php
                  require("constants.php");
                  
                  // 1. Create a database connection
                  $connection = mysqli_connect(DB_SERVER,DB_USER,DB_PASS);
                  
                  if (!$connection) {
                      error_log("Failed to connect to MySQL: " . mysqli_error($connection));
                      die('Internal server error');
                  }
                  
                  // 2. Select a database to use 
                  $db_select = mysqli_select_db($connection, DB_NAME);
                  if (!$db_select) {
                      error_log("Database selection failed: " . mysqli_error($connection));
                      die('Internal server error');
                  }
                  
                  ?>
                  

                  这篇关于mysqli_select_db() 期望参数 1 是 mysqli,给定的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Mysqli get_result 替代方案 下一篇:Mysqli 抛出“警告:mysqli_stmt_bind_param() 期望参数

                  相关文章

                  最新文章

                  • <bdo id='hSCYd'></bdo><ul id='hSCYd'></ul>

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

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

                    <tfoot id='hSCYd'></tfoot>
                    <legend id='hSCYd'><style id='hSCYd'><dir id='hSCYd'><q id='hSCYd'></q></dir></style></legend>