Jump to content


Photo

Show the first 50 items...


  • Please log in to reply
3 replies to this topic

#1 dragonstable

dragonstable
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 13 June 2006 - 11:44 AM

$data = mysql_query("SELECT * FROM items WHERE user='$username'")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
Print "<center> ".$info['itemname'] . " <br>";
Echo "<img src=http://dragonstable.fileplace.biz/".$info['image'] ."> <br>";
Print " ".$info['rarity'] . "</center><br> ";
}
?>




thats my current script just after connecting, it works but shows each of the items one under the other and in the centre of the page... Is there a way I can make it go about 4 wide and then down to the next line and repeat, and then only show the first 50 items? Please help me if any of this makes sense to you... Thanks

#2 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 13 June 2006 - 11:50 AM

"ORDER BY index ASC LIMIT 50" onto your sql query. "index" would be the "id" field from the db
z..z..z..z..z..z..z..z..

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 June 2006 - 11:54 AM

The rest is table for formating data ok.

$data = mysql_query("SELECT * FROM items WHERE user='$username'")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
Print "<center> ".$info['itemname'] . " <br>";
Echo "<img src=http://dragonstable.fileplace.biz/".$info['image'] ."> <br>"; 
Print " ".$info['rarity'] . "</center><br> ";
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 dragonstable

dragonstable
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 14 June 2006 - 01:36 AM

Thanks to both of you for helping....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users