I've been working for the past hour on this one prepared statement.
It returns 0
for the num_rows
every time.
I've run the query through my database manually in phpmyadmin and there's nothing wrong with it. And $user_id
is set fine as well.
if ($statement = $mysqli->prepare("SELECT google_id FROM google_users WHERE google_id = ? LIMIT 1"))
{
$statement->bind_param("i", $user_id);
$statement->execute();
$statement->store_result();
if ($statement->num_rows < 1)
{
$alerts .= '<div class="alert alert-danger" role="alert">Your login session was not valid. Please log in again.</div>';
}
$statement->free_result();
$statement->close();
}