I'm following a php pagination tutorial that uses MYSQL but I use MYSQLI object oriented all around my site. This is causing some errors..
For this part..
$sql = "SELECT COUNT(*) as num FROM categories";
$total_pages = $connection->query($sql) or die(mysqli_error($connection));
$total_pages = $total_pages['num'];
I get *Fatal error: Cannot use object of type mysqli_result as array*.. on the last line
so I switched it to
$sql = "SELECT COUNT(*) as num FROM categories";
$total_pages = $connection->query($sql) or die(mysqli_error($connection));
$row = $total_pages->fetch_assoc();
$total_pages = $row[num];
and now I get Use of undefined constant num - assumed 'num' ..on the last line.
At this point, I'm not sure what else to do. Can someone please help?