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

  2. <tfoot id='A11su'></tfoot>

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

      mysqli_select_db() 需要 2 个参数

      时间:2023-09-25

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

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

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

            <legend id='rH0Dz'><style id='rH0Dz'><dir id='rH0Dz'><q id='rH0Dz'></q></dir></style></legend>
              • <bdo id='rH0Dz'></bdo><ul id='rH0Dz'></ul>
                本文介绍了mysqli_select_db() 需要 2 个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                获取错误:

                警告:mysqli_select_db() 需要 2 个参数,1 个在 C:Users ootDesktopWebServerhtdocs est.php 第 9 行

                Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:Users ootDesktopWebServerhtdocs est.php on line 9

                警告:mysqli_query() 需要至少 2 个参数,其中 1 个在 C:Users ootDesktopWebServerhtdocs est.php 第 13 行

                Warning: mysqli_query() expects at least 2 parameters, 1 given in C:Users ootDesktopWebServerhtdocs est.php on line 13

                警告:mysqli_fetch_assoc() 期望参数 1 为 mysqli_result,空值在 C:Users ootDesktopWebServerhtdocs est.php 第 39 行

                Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in C:Users ootDesktopWebServerhtdocs est.php on line 39

                我没注意到这个问题,有点陌生,有人能看到问题吗?

                I can't notice the problem, kind of new to this, can anyone see the problem?

                非常感谢任何帮助!

                <?php
                
                
                //make connection
                mysqli_connect('localhost', 'root', '');
                
                
                //select db
                mysqli_select_db('altislife-dev');
                
                $sql="SELECT * FROM players";
                
                $records=mysqli_query($sql);
                
                ?>
                
                <html>
                
                    <head>
                
                        <title>Data</title>
                
                    </head>
                
                    <body>
                
                        <table width="600" border="1" cellpadding="1" cellspacing="1">
                        <tr>
                        <th>uid</th>
                        <th>name</th>
                        <th>aliases</th>
                        <th>playerid</th>
                        <th>cash</th>
                        <th>bankacc</th>
                        <th>coplevel</th>
                        <tr>
                
                        <?php
                        while($players=mysqli_fetch_assoc($records)) {
                
                            echo "<tr>";
                            echo "<td>".$players['uid']."</td>";
                            echo "<td>".$players['name']."</td>";
                            echo "<td>".$players['aliases']."</td>";
                            echo "<td>".$players['playerid']."</td>";
                            echo "<td>".$players['cash']."</td>";
                            echo "<td>".$players['bankacc']."</td>";
                            echo "<td>".$players['coplevel']."</td>";
                            echo "</tr>";
                        }
                
                        ?>
                        </table>
                    </body>
                </html>
                

                推荐答案

                做如下更正:

                $conn = mysqli_connect('localhost', 'root', '');
                

                首先必须将 select_db 中的连接变量作为第一个参数传递.如下.

                the first thing that you have to pass connection variable in the select_db as first parameter. as below.

                mysqli_select_db($conn,'altislife-dev');
                

                您还必须将 mysqli_query() 中的连接变量作为第一个参数传递,如下所示.

                also you have to pass connection variable in mysqli_query() as first parameter as given below.

                $records=mysqli_query($conn,$sql);
                

                这篇关于mysqli_select_db() 需要 2 个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Php mysql pdo 查询:用查询结果填充变量 下一篇:PHP MySQLi 无法识别登录信息

                相关文章

                最新文章

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

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

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

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