I am troubleshooting this query that I was previously trying to use to count rows but now I have discovered that 0 rows are being found in the database even though they exist. I have checked previous queries I have used and they work and look the same. The $db_conx definitely works to connect to the database as I am using it on other web pages. Does any one have any suggestions? Thanks
$result =("SELECT * FROM Request WHERE user2='joey' AND accepted='0'");
$query = mysqli_query($db_conx, $result);
$rows = mysqli_num_rows($query);
if (rows < 1) {
echo '<strong style="color:#F00;">No rows</strong>';
exit();
} else {
echo '<strong style="color:#F00;">Rows exist</strong>';
exit();
}
rowsnot equal$rows.