So I want to get a MySQL row count and I keep getting nothing instead. I keep getting the error
"Error: couldn't find the row.". When in fact the row is really there in database.
$sql = "SELECT * FROM users WHERE code = '$promo'";
$result = $conn->query($sql);
if ($result->num_rows > 0){
$rowhis = $result->fetch_assoc();
} else {
echo "Error: couldn't find the row.";
die();
}