title: Mysql get count with php prepared
body: <p>I want get count rows in my table. How can I do it?</p>
  
  <pre><code>&lt;?php
  require_once "config.php";
  $conn = new mysqli($servername, $username, $password, $dbname);
  
  $stmt = $conn-&gt;prepare("SELECT COUNT(*) FROM `books`");
  $stmt-&gt;execute();
  $result = $stmt-&gt;get_result();
  ?&gt;
  </code></pre>