title: How do I enable mysqli on Mac OS X Snow Leopard?
body: <p>I am trying to enable mysqli on Mac OS X. I am using MAMP and I have tried XAMPP (I am open to either), but when I open the php.ini file and search for anything containing the word "mysqli" nothing is found, and when I try to run a PHP script containing any mysqli code, nothing happens: no errors are output, the script just fails to execute.</p>
  
  <p>When I try to connect by</p>
  
  <pre><code>$dbh = new mysqli("localhost","root","root");
  </code></pre>
  
  <p>and I dump the variable <code>$dbh</code> it outputs:</p>
  
  <pre><code>object(mysqli)#1 (17) { ["affected_rows"]=&gt; int(0) ["client_info"]=&gt; string(5) "5.5.9" ["client_version"]=&gt; int(50509) ["connect_errno"]=&gt; int(0) ["connect_error"]=&gt; NULL ["errno"]=&gt; int(0) ["error"]=&gt; string(0) "" ["field_count"]=&gt; int(0) ["host_info"]=&gt; string(25) "Localhost via UNIX socket" ["info"]=&gt; NULL ["insert_id"]=&gt; int(0) ["server_info"]=&gt; string(5) "5.5.9" ["server_version"]=&gt; int(50509) ["sqlstate"]=&gt; string(5) "00000" ["protocol_version"]=&gt; int(10) ["thread_id"]=&gt; int(12) ["warning_count"]=&gt; int(0) }
  </code></pre>
  
  <p>This is the code I tried:</p>
  
  <pre><code>$dbh = new mysqli("localhost","root","root");
  $dbh-&gt;select_db("php");
  $dbh-&gt;query("SELECT * FROM test");
  $count = $dbh-&gt;num_rows;
  var_dump($count);
  </code></pre>
  
  <p>and the output is</p>
  
  <pre><code>NULL
  </code></pre>