title: SQL Query always returning 1 regardless of result
body: <p>I am creating a function in PHP to count the number of same emails in my SQL table, however the function is returning 1 regardless of result. Here is my PHP code:</p>
  <pre><code>$query = Query($conn, &quot;SELECT COUNT(*) FROM `users` AS total WHERE `email` = '$email&quot;);
  return $query-&gt;fetch();
  </code></pre>
  <p>I have run the function in phpmyadmin and it returns the correct count but, in PHP it fails.<br>
  Note:
  I have another function which is nearly same and it is working perfactly:</p>
  <pre><code>$query = Query($conn, &quot;SELECT COUNT(*) as total
      FROM `passwords` WHERE `password` = '$pwd'&quot;);
  return $query-&gt;fetch();
  </code></pre>