title: prepared statement fatal error non-object
body: <p>I got this query to insert a row in my table, but it gives this error</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function bindParam() on a non-object in */misc/php/process.php on line 35</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>$query =  mysqli_query($conn, "INSERT INTO pm     (van,naar,status,admin,onderwerp,tijd,bericht)   VALUES(:van,:naar,:status,:admin,:onderwerp,:tijd,:bericht)");
      $stmt = $conn-&gt;prepare($query);
      $stmt-&gt;bindParam(':van', $van); //&lt;-- line 35
      $stmt-&gt;bindParam(':naar', $naar);
      $stmt-&gt;bindParam(':status', $status);
      $stmt-&gt;bindParam(':admin', $admin);
      $stmt-&gt;bindParam(':onderwerp', $onderwerp);
      $stmt-&gt;bindParam(':tijd', $tijd);
      $stmt-&gt;bindParam(':bericht', $bericht);
  $stmt-&gt;execute();
  $stmt-&gt;close();
  </code></pre>