Jump to content

Displaying an empty page in Pagination


TeddyKiller

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.