title: MySQLi Equivalent Of MySQL Code
body: <p>Can you give me the equivalent of this code im MySQLi? Can't get it right.</p>
  
  <pre><code>&lt;?php
  if(mysql_num_rows(mysql_query("SELECT userid FROM users WHERE userid = '$userid'"))){
  //code to be exectued if user exists
  } 
  ?&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong> Care to explain to me what is wrong?</p>
  
  <pre><code>$mysqli = new mysqli($host, $username, $pass, $db);
  
  if ($mysqli-&gt;connect_error) {
      die('The Server Is Busy. Please Try Again Later.');
  }
  $result = $mysqli-&gt;query("SELECT userid FROM users WHERE userid = '$userid'");
  if ($result-&gt;num_rows) {
      echo "&lt;h1&gt;AWESOME&lt;/h1&gt;";
  }
  </code></pre>