I have this code which is part of an AJAX function where 5 rows are added to $opslaglimit
each time the user reaches the bottom of the page.
$opslaglimit = 5;
$opslag = $db->prepare("SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id LIMIT $opslaglimit");
I want to make a function, so I can display a message to the user when there are no rows left to collect from the database that matches the query.
I know this can be achieved by making an other query without the LIMIT and then compare the count. This just seems like a bit of code and I want to hear if any of you knows a more simple way.
Thanks