SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Order by Descending
-
Dec 14, 2009, 03:54 #1
Order by Descending
I have a small script that is fetching data as
Code:$sql=mysql_query("SELECT * FROM messages LIMIT 9"); while($row=mysql_fetch_array($sql)) { $msg=$row['msg']; $mes_id=$row['mes_id']; $up=$row['up']; $down=$row['down']; ?>
Code:$sql=mysql_query("SELECT * FROM messages LIMIT 9 ORDER BY up DESC");
What is the problem here
Thanks
-
Dec 14, 2009, 04:13 #2
OK a quick update, I have got it working I just had to remove that LIMIT 9 from the script
what exactly does the limit 9 does ? can I remove it permanently ?
-
Dec 14, 2009, 05:03 #3
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
LIMIT 9 means "return only 9 rows"
put it back after the ORDER BY, not in front
-
Dec 14, 2009, 11:57 #4
Bookmarks