title: How to run the bind_param() statement in PHP?
body: <p>I'm trying to make the following code work but I can't reach the <code>execute()</code> line.</p>
  
  <pre class="lang-php prettyprint-override"><code>$mysqli = $this-&gt;ConnectLowPrivileges();
  echo 'Connected&lt;br&gt;';
  $stmt = $mysqli-&gt;prepare("SELECT `name`, `lastname` FROM `tblStudents` WHERE `idStudent`=?");
  echo 'Prepared and binding parameters&lt;br&gt;';
  $stmt-&gt;bind_param('i', 2 );
  echo 'Ready to execute&lt;br&gt;'
  if ($stmt-&gt;execute()){
      echo 'Executing..';
      }
  } else {
      echo 'Error executing!';
  }
  mysqli_close($mysqli);
  </code></pre>
  
  <p>The output that I get is:</p>
  
  <pre class="lang-none prettyprint-override"><code>Connected
  Prepared and binding parameters
  </code></pre>
  
  <p>So the problem <em>should</em> be at line 5, but checking the <a href="http://www.php.net/manual/en/mysqli-stmt.bind-param.php">manual of <code>bind_param()</code></a> I can't find any syntax error there.</p>