title: PHP Prep. Stmt - What is wrong?
body: <p>I'm trying to learn PHP with prepared statements and I have had some frustrating errors before but I figured them out by myself ( after 4 frustrating hours ). Now i'm getting this error : 
  Fatal error: Call to a member function bind_param() on a non-object in .... on line 15.</p>
  
  <pre><code>&lt;?php
  $host="127.0.0.1";
  $port=3306;
  $socket="";
  $user="root";
  $password="";
  $dbname="ewt";
  
  $con = new mysqli($host, $user, $password, $dbname, $port, $socket)
  or die ('Could not connect to the database server' . mysqli_connect_error());
  
  $mysqli = $con;
  
  $stmt = $mysqli-&gt;prepare("INSERT INTO PERSOON VALUES (?,?,?,?,?,?,?,?)");
  $stmt-&gt;bind_param('ssssssid',$firstName,$lastName,$email,$pass,$address,$city,$zip,$telephone);
  
  $firstName = $_POST['firstName'];
  $lastName = $_POST['lastName'];
  $email = $_POST['email'];
  $pass = $_POST['pass'];
  $address = $_POST['address'];
  $city = $_POST['city'];
  $zip = $_POST['zip'];
  $telephone = $_POST['telephone'];
  
  $stmt-&gt;execute();
  $stmt-&gt;close();
  $mysqli-&gt;close();
  </code></pre>
  
  <p>I have absolutely no idea what's wrong with the code.</p>