title: mysqli_query() expects parameter 1 to be mysqli, resource given in ~\index.php on line 46
body: <p>Here is the code that is giving me the <strong>Warning</strong></p>
  
  <pre><code>$query = mysqli_query($connection, $sql);
  $uname_check = mysqli_num_rows($query);
  </code></pre>
  
  <p>What is the problem here ?
  Similar code elsewhere in the page is working.</p>
  
  <p>Also, I am getting the following error in the next line of code:</p>
  
  <pre><code>mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in ~\index.php on line 47
  </code></pre>