title: Count number of rows in Mysql using PHP7
body: <p>I have upgraded PHP on my server from version 5 to 7 and I found out that <code>mysql_*</code> functions were removed and now I should use mysqli or PDO. I updated the following code (mysqli instead of mysql) that I used to print number of rows in a given table, but it doesn't work as it used to. </p>
  
  <pre><code>$link = mysql_connect("xxx", "xxx", "xxx");
  mysql_select_db("xxx", $link);
  
  $result = mysql_query("SELECT * FROM blackandwhite", $link);
  $num_rows = mysql_num_rows($result);
  
  echo "$num_rows Rows\n"; // This works in PHP5
  </code></pre>
  
  <p>Updated code PHP7:</p>
  
  <pre><code>$link = mysqli_connect("xxx", "xxx", "xxx");
  mysqli_select_db("xxx", $link);
  
  $result = mysqli_query("SELECT * FROM blackandwhite", $link);
  $num_rows = mysqli_num_rows($result);
  
  echo "$num_rows Rows\n"; // This doesnt work anymore.
  </code></pre>