I have a MYSQL table below and I am trying to retrieve the number of records between specific dates.
I am getting the following error:
'Trying to get property 'num_rows' of non-object in /var/www/html/dev/timeTest.php on line 18'
date column of MySQL table:
PHP:
$date1 = '2018-07-01';
$date2 = '2018-07-30';
$sql = "SELECT * FROM scanUploads WHERE dateUpload BETWEEN {$date1} AND {$date2}";
$result = $mysqli -> query($sql);
$count = $result -> num_rows; // LINE 18
echo 'records: '.$count;

$result -> num_rows;should it be this?$result->num_rows;