title: Mysqli throws "Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given"
body: <p>I know that this code works on another site I've got but it's not playing ball today.
  I get three warnings:</p>
  <blockquote>
  <p>Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 33</p>
  <p>Warning: mysqli_execute() expects parameter 1 to be mysqli_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 34</p>
  <p>Warning: mysqli_stmt_affected_rows() expects parameter 1 to be mysqli_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 35</p>
  </blockquote>
  <p>Can someone help me figure this out?</p>
  <p>I am having to use htaccess to upgrade to PHP5 if this helps.</p>
  <pre><code>$connection = mysqli_connect($hostname, $username, $password, $dbname);
  
  if (!$connection) {
      die('Connect Error: ' . mysqli_connect_error());
  }
  
  $query = &quot;INSERT INTO entries (name, dob, school, postcode, date) VALUES (?,?,?,?,?)&quot;;
  $stmt1 = mysqli_prepare($connection, $query);
  mysqli_stmt_bind_param($stmt1, 'sssss',$name,$dob,$school,$postcode,$date);
  mysqli_execute($stmt1);
  if(mysqli_stmt_affected_rows($stmt1) != 1)
      die(&quot;issues&quot;);
  mysqli_stmt_close($stmt1);
  return &quot;new&quot;;
  </code></pre>
  <p>EDIT</p>
  <p>After some investigation it transpires that the prepare statement doesn't play ball with mysql4. I have created a new mysql5 database but I now get this error when I try to connect:</p>
  <blockquote>
  <p>Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'localhost:/tmp/mysql5.sock' (1)</p>
  </blockquote>
  <p>Does anyone have any idea as to why this is happening?</p>