Jump to content


Descending


1 reply to this topic

#1 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 14 July 2005 - 04:01 PM

Okay say I have a script like this:

<?php
$result = mysql_query("SELECT * FROM table name ORDER BY ID DESC");
while($row = mysql_fetch_array($result))
{
echo $row['id'];
}
?>

how can I am all of the ids go down instead of starting with 1 - 10 be like 10 all the way down to 1.

I hope I make sense

EDIT %< Got it to work

dEcade

Edited by dEcade, 14 July 2005 - 04:22 PM.


#2 Jaymz

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 4,104 posts

Posted 14 July 2005 - 04:22 PM

<?php
$result = mysql_query("SELECT * FROM table name WHERE id<10 ORDER BY ID DESC LIMIT 0,10");
while($row = mysql_fetch_array($result))
{
echo $row['id'];
}
?>






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users