jesushax Posted April 15, 2009 Share Posted April 15, 2009 hi all hope i make sense here, personally i dont see how it can be done, but will ask if anyones got an idea anyway. at the moment everyone in the directory is listed alphabetically, which is unfair on members really, only ones beginging with A are every going to make the front page, i need a more fair way of doing it. i though of using random, then everyone would get a go, but with using pagnation if a user clicked page 2 another set of random records would appear, not the orginal random list. how could we create a random list and keep that list for pagnation? below current code $Trade = urldecode($_GET["Trade"]); $max = 10; $p = @$_GET['p']; if(empty($p)) { $p = 1; } $limits = ($p - 1) * $max; $SQL = mysql_query("SELECT * FROM tblDirectory2 WHERE Sect1_2 LIKE '%$Trade%' ORDER BY Sect1_4 ASC LIMIT ".$limits.",$max") or die (mysql_error()); $totalres = mysql_result(mysql_query("SELECT COUNT(CompanyID) AS tot FROM tblDirectory2 WHERE Sect1_2 LIKE '%$Trade%' "),0); $totalpages = ceil($totalres / $max); Thanks Link to comment https://forums.phpfreaks.com/topic/154167-pagnation-but-with-random-order-remembered/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.