title: Fatal error: Call to a member function prepare() on a non-object in
body: <p>this is how I have to build the transmitters infomation on to a php file to send to login page when it is</p>
  
  <pre><code>&lt;form action="http://,,,.dk/activate_updater.php" method="post" name="formular" onsubmit="return validerform ()"&gt;
                                   &lt;table border="0"&gt;
                                       &lt;tr&gt;
                                           &lt;td id="tb-w_a"&gt;&lt;p&gt;Kategori&lt;/p&gt;&lt;/td&gt;
                                           &lt;td&gt;:&lt;/td&gt;
                                           &lt;td&gt;
                                           &lt;select name="kategori"&gt;
                                           &lt;?php
                                           $query = "SELECT id_katogori, navn FROM kategori";
                                           $result = $mysqli-&gt;query($query);
                                           while(list($id_katogori, $navn) = $result-&gt;fetch_row())
                                           {
                                               echo "&lt;option value=\"$id_katogori\"&gt;$navn&lt;/option&gt;";  
                                           }
                                           ?&gt;
                                           &lt;/select&gt;
                                           &lt;/td&gt;
                                       &lt;/tr&gt;
                                       &lt;tr&gt;
                                           &lt;td id="tb-w_a"&gt;&lt;p&gt;Djnavn&lt;/p&gt;&lt;/td&gt;
                                           &lt;td&gt;:&lt;/td&gt;
                                           &lt;td&gt;&lt;input type="text" name="djnavn"&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                       &lt;tr&gt;
                                           &lt;td id="tb-w_a"&gt;&lt;p&gt;Facebook&lt;/p&gt;&lt;/td&gt;
                                           &lt;td&gt;:&lt;/td&gt;
                                           &lt;td&gt;&lt;input type="text" name="facebook"&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                       &lt;tr&gt;
                                           &lt;td id="tb-w_a"&gt;&lt;p&gt;Pris&lt;/p&gt;&lt;/td&gt;
                                           &lt;td&gt;:&lt;/td&gt;
                                           &lt;td&gt;&lt;input type="text" name="pris"&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                       &lt;tr&gt;
                                           &lt;td id="tb-w_a"&gt;&lt;p&gt;Booking Email&lt;/p&gt;&lt;/td&gt;
                                           &lt;td&gt;:&lt;/td&gt;
                                           &lt;td&gt;&lt;input type="email" name="booking"&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                       &lt;tr&gt;
                                           &lt;td id="tb-w_a"&gt;&lt;p&gt;Mobil&lt;/p&gt;&lt;/td&gt;
                                           &lt;td&gt;:&lt;/td&gt;
                                           &lt;td&gt;&lt;input type="text" name="mobil"&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                       &lt;tr&gt;
                                           &lt;td id="tb-w_a"&gt;&lt;p&gt;Upload Profil&lt;/p&gt;&lt;/td&gt;
                                           &lt;td&gt;:&lt;/td&gt;
                                           &lt;td&gt;&lt;input type="file" name="profilbillede" /&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                   &lt;/table&gt;
                               &lt;textarea name="profiltekst" style="width:500px; height:170px;"&gt;&lt;/textarea&gt;&lt;br /&gt;
                               &lt;input type="submit" value="Godkend brugere" name="godkendt-brugere"&gt;
                           &lt;/form&gt;
  </code></pre>
  
  <p>so the new page file is like this where there are <strong>errors</strong> on the page ..</p>
  
  <pre><code>&lt;?php
       if($stmt = $mysqli-&gt;prepare('UPDATE `brugere` SET `rank`=2, `katogori`=?, `djnavn`=?, `profilbillede`=?, `profiltekst`=?, `facebook`=?, `pris`=?, `booking`=?, `mobil`=? WHERE `code`=?'))
       {
  
           $stmt-&gt;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-&gt;execute();
           $stmt-&gt;close();
           header('http://....dk/ (...));
       }
       else
       {
           echo 'Der opstod en fejl i erklÃ¦ringen: ' . $mysqli-&gt;error;
       }
   ?&gt;
  </code></pre>
  
  <p>but when it comes onto the file / page says it like this ...</p>
  
  <p><strong>Fatal error: Call to a member function prepare() on a non-object in /home/jesperbo/public_html/....dk/activate_updater.php on line 2</strong></p>
  
  <p>that is the where it says like this</p>
  
  <pre><code>if($stmt = $mysqli-&gt;prepare('UPDATE `brugere` SET `rank`=2, `katogori`=?, `djnavn`=?, `profilbillede`=?, `profiltekst`=?, `facebook`=?, `pris`=?, `booking`=?, `mobil`=? WHERE `code`=?'))
  </code></pre>
  
  <p><em>I'm not exactly the best person to see the error but it would be super if you had seen what I've needless churning wrong since it will not be up on the database</em></p>
  
  <p><strong>hope you can help me with this problem!</strong></p>