title: Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given?
body: <p>this is the first time ever that I am trying to secure my code against sql injection using <code>mysqli prepared statement</code>. so please be gentle and explain things in simple terms so I can understand it.</p>
  
  <p>Now I am using the following code which I thought i was right but it throws these errors and I do not understand that at all.</p>
  
  <p><strong>here is the errors:</strong></p>
  
  <pre><code>Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in on line 92
  
  Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, boolean given in on line 93
  
  Warning: mysqli_stmt_close() expects parameter 1 to be mysqli_stmt, boolean given in  on line 96
  </code></pre>
  
  <p><strong>here is the code:</strong></p>
  
  <pre><code>$stmt = mysqli_prepare(
      $db_conx,
      "INSERT $storenameTable (firstname, lastname, username, address_1, address_2, postcode,  country, county, city, email, password, storeShop, signupdate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
  );
  //after validation, of course
  mysqli_stmt_bind_param($stmt, "issi", $firstname, $lastname, $username, $address_1, $address_2, $postcode, $country, $county, $city, $email, $hashedPass, $storenameTable);
  mysqli_stmt_execute($stmt);     &lt;//&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; line 92
  if (mysqli_affected_rows($db_conx))     &lt;//&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; line 93
  {
      mysqli_stmt_close($stmt);  &lt;//&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; line 96
      //update was successful
      $id = mysqli_insert_id($db_conx);
  }
  </code></pre>
  
  <p>i would appreciate your help.</p>