title: Fatal error: Call to a member function bind_param() on a non-object on line 17
body: <p>I'm writing this script</p>
  
  <pre><code>&lt;form method="post" id="form" action="join_config.php"&gt;
      &lt;label&gt;First Name&lt;/label&gt;
      &lt;input name="first_name" type="text" id="firstname"&gt;
  
      &lt;label&gt;Last Name&lt;/label&gt;
      &lt;input name="last_name" type="text" id="lastname"&gt;
  
      &lt;label&gt;Email&lt;/label&gt;
      &lt;input name="email" type="email"&gt;
  
      &lt;label&gt;Twitter Handle&lt;/label&gt;
      &lt;input name="twitter" type="text"&gt;
  
      &lt;label&gt;Country&lt;/label&gt;
      &lt;input name="country" type="text"&gt;
  
      &lt;label&gt;City&lt;/label&gt;
      &lt;input name="city" type="text"&gt;
  
      &lt;label&gt;Phone&lt;/label&gt;
      &lt;input name="phone" type="checkbox"&gt;iPhone
      &lt;input name="phone" type="checkbox"&gt;Samsung
      &lt;input name="phone" type="checkbox"&gt;HTC
      &lt;input name="phone" type="checkbox"&gt;Nokia
  
      &lt;p style="margin-bottom:0;"&gt;Others:&lt;/p&gt;&lt;input name="phone" type="text"&gt;
          &lt;label&gt;Availability&lt;/label&gt;
          &lt;input name="availability" type="text"&gt;
          &lt;input name="submit" type="submit" value="Submit" id="#submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And my PHP mysqli code</p>
  
  <pre><code>&lt;?php 
  
      $firstname = $_POST['first_name'];
      $lastname = $_POST['last_name'];
      $email = $_POST['email'];
      $twitter = $_POST['twitter'];
      $country = $_POST['country'];
      $city = $_POST['city'];
      $phone = $_POST['phone'];
      $availability = $_POST['availability'];
      $date = date("d.m.y");
  
      $SQL = "INSERT INTO join(first_name, last_name, email, twitter, country, city, phone, availability, date)VALUES('$firstname','$lastname','$email','$twitter','$country','$city','$phone','$availability','$date')";
      echo $SQL . "&lt;br&gt;";
  
      include_once('inc/config.php');
  
      $stmt = $db-&gt;prepare("INSERT INTO join VALUES (?,?)");
      $stmt-&gt;bind_param('ss', $firstname, $lastname);
      $stmt-&gt;execute();
      $stmt-&gt;close();
  
  ?&gt;
  </code></pre>
  
  <p>When i'm running it i'm getting this error:</p>
  
  <pre><code>Fatal error: Call to a member function bind_param() on a non-object in /join_config.php on line 17
  </code></pre>
  
  <p>I'm running on mac OSX Lion and will include the security threads later but first i need to insert into my database.</p>
  
  <p>Any help or suggestions?</p>