TeddyKiller Posted July 7, 2010 Share Posted July 7, 2010 http://www.phpfreaks.com/tutorial/basic-pagination I used this pagination and it generates an extra page in which displays no results in it. My first query... is $query = $db->execute("SELECT sm.*, u.displayname, u.id as userid, u.avatar FROM sent_messages as sm, users as u WHERE sm.from_status = '0' AND sm.from_id = '$user->id' AND u.id = sm.to_id ORDER BY sm.date DESC"); It should ideally have COUNT() somewhere in it, instead of of all the selects, but I'm not sure how I'd do it, because wouldn't it be SELECT COUNT(sm.*, u.*) but not sure... Also, how would it be changed so that if you go on a page that doesn't exist, to display a 'this page does not exist' thing maybe Thanks Link to comment https://forums.phpfreaks.com/topic/207029-displaying-an-empty-page-in-pagination/ Share on other sites More sharing options...
TeddyKiller Posted July 7, 2010 Author Share Posted July 7, 2010 Oh nevermind, using COUNT(*) worked, and fixed both issues. Link to comment https://forums.phpfreaks.com/topic/207029-displaying-an-empty-page-in-pagination/#findComment-1082564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.