I want to ask why am I getting this error:
Trying to get property 'num_rows' of non-object
with the following code:
$sql = "SELECT * FROM $table_name ORDER BY Author";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {...
I have used echo $sql
to look if the problem lies there, but there is no problem. My SQL looks fine.
I have tried to use Prepared Statements
and got other errors too.
The line which gives the error is the one with the if
statement.
Any ideas?