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

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

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

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

        致命错误:在非对象上调用成员函数 prepare()

        时间:2023-07-29
                <tfoot id='u8sU8'></tfoot>

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

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

                  本文介绍了致命错误:在非对象上调用成员函数 prepare()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  这就是我必须将发送器信息构建到 php 文件以在登录页面时发送到登录页面的方式

                  this is how I have to build the transmitters infomation on to a php file to send to login page when it is

                  <form action="http://,,,.dk/activate_updater.php" method="post" name="formular" onsubmit="return validerform ()">
                                                   <table border="0">
                                                       <tr>
                                                           <td id="tb-w_a"><p>Kategori</p></td>
                                                           <td>:</td>
                                                           <td>
                                                           <select name="kategori">
                                                           <?php
                                                           $query = "SELECT id_katogori, navn FROM kategori";
                                                           $result = $mysqli->query($query);
                                                           while(list($id_katogori, $navn) = $result->fetch_row())
                                                           {
                                                               echo "<option value="$id_katogori">$navn</option>";  
                                                           }
                                                           ?>
                                                           </select>
                                                           </td>
                                                       </tr>
                                                       <tr>
                                                           <td id="tb-w_a"><p>Djnavn</p></td>
                                                           <td>:</td>
                                                           <td><input type="text" name="djnavn"></td>
                                                       </tr>
                                                       <tr>
                                                           <td id="tb-w_a"><p>Facebook</p></td>
                                                           <td>:</td>
                                                           <td><input type="text" name="facebook"></td>
                                                       </tr>
                                                       <tr>
                                                           <td id="tb-w_a"><p>Pris</p></td>
                                                           <td>:</td>
                                                           <td><input type="text" name="pris"></td>
                                                       </tr>
                                                       <tr>
                                                           <td id="tb-w_a"><p>Booking Email</p></td>
                                                           <td>:</td>
                                                           <td><input type="email" name="booking"></td>
                                                       </tr>
                                                       <tr>
                                                           <td id="tb-w_a"><p>Mobil</p></td>
                                                           <td>:</td>
                                                           <td><input type="text" name="mobil"></td>
                                                       </tr>
                                                       <tr>
                                                           <td id="tb-w_a"><p>Upload Profil</p></td>
                                                           <td>:</td>
                                                           <td><input type="file" name="profilbillede" /></td>
                                                       </tr>
                                                   </table>
                                               <textarea name="profiltekst" style="width:500px; height:170px;"></textarea><br />
                                               <input type="submit" value="Godkend brugere" name="godkendt-brugere">
                                           </form>
                  

                  所以新的页面文件是这样的,页面上有错误..

                  so the new page file is like this where there are errors on the page ..

                  <?php
                       if($stmt = $mysqli->prepare('UPDATE `brugere` SET `rank`=2, `katogori`=?, `djnavn`=?, `profilbillede`=?, `profiltekst`=?, `facebook`=?, `pris`=?, `booking`=?, `mobil`=? WHERE `code`=?'))
                       {
                  
                           $stmt->bind_param('iiiiiiiis', $katogori, $djnavn, $profilbillede, $profiltekst, $facebook, $pris, $booking, $mobil, $g_code);
                           //fra input ting ting..
                           $katogori = $_POST["kategori"];
                           $djnavn = $_POST["djnavn"];
                           $profilbillede = $_POST["profilbillede"];
                           $profiltekst = $_POST["profiltekst"];
                           $facebook = $_POST["facebook"];
                           $pris = $_POST["pris"];
                           $booking = $_POST["booking"];
                           $mobil = $_POST["mobil"];
                           $g_code = $_GET["code"];
                  
                           $stmt->execute();
                           $stmt->close();
                           header('http://....dk/ (...));
                       }
                       else
                       {
                           echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error;
                       }
                   ?>
                  

                  但是当它出现在文件/页面上时会这样说......

                  but when it comes onto the file / page says it like this ...

                  致命错误:在第 2 行的/home/jesperbo/public_html/....dk/activate_updater.php 中的非对象上调用成员函数 prepare()

                  就是这样写的

                  if($stmt = $mysqli->prepare('UPDATE `brugere` SET `rank`=2, `katogori`=?, `djnavn`=?, `profilbillede`=?, `profiltekst`=?, `facebook`=?, `pris`=?, `booking`=?, `mobil`=? WHERE `code`=?'))
                  

                  我不是最能看到错误的人,但如果你看到我不必要的错误,因为它不会出现在数据库中,那就太好了

                  希望你能帮我解决这个问题!

                  推荐答案

                  发生这种情况是因为 $mysqli 不是您认为的对象.'没有正确实例化 MySQLi 类,或者它没有建立连接.执行 var_dump($mysqli) 以获取有关问题的更多信息.

                  This is happening because $mysqli isn't the object you think it is. Either you didn't instantiate the MySQLi class properly, or it didn't make a connection. Do a var_dump($mysqli) to get more info as to what's going wrong.

                  这篇关于致命错误:在非对象上调用成员函数 prepare()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:警告:mysqli_query() 期望参数 1 是 mysqli,字符串在 下一篇:致命错误:调用未定义的方法 mysqli_stmt::get_result

                  相关文章

                  最新文章

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

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