widget Posted April 6, 2007 Share Posted April 6, 2007 Hey all, Im having a pagination problem. I've been trying for days and for the life of me I cant get it to work. The scenario is... My site is a virtual pet style site where there are user shops and at the moment all items are displayed in one long page, not so great when theres over 100 products in one store. Below is a copy of the code. If anyone could please give me some pointers, Id really appreciate it. I've gone through tutorials but they seems to be to advaced for what I need and I simply get lost. $x = 0; $query = mysql_query("SELECT * FROM usershops_items2 WHERE owner = '$find_owner[id]' AND price > '0' AND game = '$game' ORDER BY item_id"); while ($array = mysql_fetch_array($query)) { $get_item = fetch("SELECT * FROM items2 WHERE id = '$array[item_id]' AND game = '$game'"); $y = $x % 5; if ($y == 0) { echo "<tr>"; } echo "<td><p align=center><a href='usershop.pro.php?game=$game&user=$user&id=$array[id]&price=$array[price]' onClick=\"if ( !confirm ('Are you sure you want to purchase this $get_item[item_name] for $array[price] $pointsVar?') ) { return false; }\"><img src=$base_url/images/user_images/opg_$game/items/item_$get_item[id].gif><br><font size=1><b>$get_item[item_name]</b><br>$array[stock] in Stock<br><i>$array[price] $pointsVar</i></A></p><br><br></td>"; if ($y == 4) { echo "</tr>"; } $x++; } Link to comment https://forums.phpfreaks.com/topic/45908-pagination-problem/ Share on other sites More sharing options...
Gnub Posted April 6, 2007 Share Posted April 6, 2007 I suggest using the PHPFreaks Pagination Tutorial, Easy as Prev 123 Next. I've just finished my pagination, using theirs as a guide. Link to comment https://forums.phpfreaks.com/topic/45908-pagination-problem/#findComment-223015 Share on other sites More sharing options...
widget Posted April 6, 2007 Author Share Posted April 6, 2007 Thanks, I tried that one and didnt have any luck. I guess Ill try again tomorrow after I've had some sleep. Link to comment https://forums.phpfreaks.com/topic/45908-pagination-problem/#findComment-223016 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.