Jump to content

Pagination Problem


widget

Recommended Posts

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

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.