I have the following code for activating a user account:
include 'connect.php';
$Con = new mysqli($Host, $Username, $Password, $Db) or die(mysql_error()); // Connect to database server(localhost) with username and password.
if(isset($_GET['Email']) && !empty($_GET['Email']) AND isset($_GET['Hash']) && !empty($_GET['Hash']))
{
// Verify data
$Email = mysqli_real_escape_string($Con,$_GET['Email']); // Set email variable
$Hash = mysqli_real_escape_string($Con,$_GET['Hash']); // Set hash variable
$search = $Con->query("SELECT * FROM members_security WHERE Email='.$Email.' and Active='0'"
;
$result = mysqli_fetch_array($search);
$numRows = mysqli_num_rows($result);
echo $numRows;
}
I am getting this error message:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given
$Email and $Hash are correct, I can't figure out why the query is not working.
Appreciate any guidance.