Jump to content

Recommended Posts

Ok heres the deal...

 

I'm using php and mysql for a virtual pet site Im making.

 

My problem....

 

Items available in a user shop all load on the one page.

I need it to only display say 80 items at a time.

 

Here is the code.

 

<?php

/*

User-run Shops (usershop.php)

*/

$page_title = "User-run Shops";
$rank_check = 1;
include "header.inc.php";

print "$openHTML";

$find_owner = fetch("SELECT id,rank FROM members2 WHERE username = '$user' AND game = '$game'");
$find_shop = fetch("SELECT * FROM usershops2 WHERE owner = '$find_owner[id]' AND game = '$game'");

if ($find_owner[rank] == 0)
{
die("<table width=100% border=1 cellpadding=4 cellspacing=0 bordercolor=#CCCCCC bgcolor=#FFFFFF>
  <tr>
    <td><p align=center class=error>This user has been suspended.
<script type=\"text/javascript\"><!--
google_ad_client = \"pub-1131506519615518\";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = \"468x60_as\";
google_ad_type = \"text_image\";
//2007-05-15: users_shop
google_ad_channel = \"7041872983\";
google_color_border = \"FFFFFF\";
google_color_bg = \"FFFFFF\";
google_color_link = \"F24475\";
google_color_text = \"000000\";
google_color_url = \"000000\";
//-->
</script>
<script type=\"text/javascript\"
  src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script></p></td>
  </tr>
</table>
$closeHTML");
}

if (!$find_shop[id])
{
die("<table width=100% border=1 cellpadding=4 cellspacing=0 bordercolor=#CCCCCC bgcolor=#FFFFFF>
  <tr>
    <td>This user does not have a shop.<script type=\"text/javascript\"><!--
google_ad_client = \"pub-1131506519615518\";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = \"468x60_as\";
google_ad_type = \"text_image\";
//2007-05-15: users_shop
google_ad_channel = \"7041872983\";
google_color_border = \"FFFFFF\";
google_color_bg = \"FFFFFF\";
google_color_link = \"F24475\";
google_color_text = \"000000\";
google_color_url = \"000000\";
//-->
</script>
<script type=\"text/javascript\"
  src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script></td>
  </tr>
</table>$closeHTML");
}

print "<table width=100% border=1 cellpadding=4 cellspacing=0 bordercolor=#CCCCCC bgcolor=#FFFFFF>
  <tr>
    <td><p><script type=\"text/javascript\"><!--
google_ad_client = \"pub-1131506519615518\";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = \"468x60_as\";
google_ad_type = \"text_image\";
//2007-05-15: users_shop
google_ad_channel = \"7041872983\";
google_color_border = \"FFFFFF\";
google_color_bg = \"FFFFFF\";
google_color_link = \"F24475\";
google_color_text = \"000000\";
google_color_url = \"000000\";
//-->
</script>
<script type=\"text/javascript\"
  src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script><br><br><b>$find_shop[shop_name]</B> <font size=-1><i>size $find_shop[shop_size]</i></font></p><p>$find_shop[shop_desc]</p>

<center><br><br><table width=100% cellpadding=10>";

$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></td>";
if ($y == 4)
{
	echo "</tr>";
}
$x++;
}
print "</table></center><script type=\"text/javascript\"><!--
google_ad_client = \"pub-1131506519615518\";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = \"468x60_as\";
google_ad_type = \"text_image\";
//2007-05-15: users_shop
google_ad_channel = \"7041872983\";
google_color_border = \"FFFFFF\";
google_color_bg = \"FFFFFF\";
google_color_link = \"F24475\";
google_color_text = \"000000\";
google_color_url = \"000000\";
//-->
</script>
<script type=\"text/javascript\"
  src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script></td>
  </tr>
</table>";

print "$closeHTML";
?>

 

Can anyone help?

 

I've tried a couple of tutorials without any success.

Link to comment
https://forums.phpfreaks.com/topic/51994-pagination-can-you-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.