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

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

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

      1. 如何将多个参数绑定到 MySQLi 查询

        时间:2023-07-31
          <tbody id='X6wSn'></tbody>

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

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

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

                2. 本文介绍了如何将多个参数绑定到 MySQLi 查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个 mysql 查询,但我无法为其绑定参数

                  I have a mysql query, but I can't bind param for it

                  SELECT users.email,users.handle,userprofile.mobile FROM users,userprofile WHERE users.email =? OR users.handle =? OR userprofile.mobile=?
                  

                  我试过下面的线

                  $query = "SELECT users.email,users.handle,userprofile.mobile FROM users,userprofile WHERE users.email =? OR users.handle =? OR userprofile.mobile=?";
                  $stmt = $mysqli->prepare($query);
                  $stmt->bind_param("sss",$email,$username,$mobile);
                  if ($stmt->execute()) {
                  if($stmt->num_rows){
                     echo '......';
                      }
                  }
                  

                  但我收到了错误:

                  警告:mysqli_stmt::bind_param():类型中的元素数定义字符串与绑定变量的数量不匹配

                  Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables

                  推荐答案

                  这是mysqli

                  $SQL = "SELECT 
                                users.email,
                                users.handle,
                                userprofile.mobile 
                          FROM users,userprofile      
                          WHERE users.email =? OR users.handle =? OR userprofile.mobile=?";
                  
                  $stmt = $mysqli->prepare($SQL);
                     
                  $stmt->bind_param("sss", $one,$two,$three);
                  $stmt->execute();
                  
                  //do stuff
                  

                  这篇关于如何将多个参数绑定到 MySQLi 查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:MySQLI 使用 call_user_func_array 绑定参数 下一篇:php 警告:mysqli_close() 期望参数 1 是 mysqli

                  相关文章

                  最新文章

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

                    <tfoot id='trKIi'></tfoot>
                  1. <small id='trKIi'></small><noframes id='trKIi'>

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