Thread: Order By
View Single Post
Old 02-20-2008, 10:21 PM   #1 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default Order By

Right I got this sql table called `allepisodes` that has 2 rows one called seasons and one called episodes.

The more data i add all have different seasons and different episodes, but when i output the episodes I want them to be ordered by the season in asc order and i also want to order them by the episode # so E.G::

Code:
id | episode | season | episodename
1 | 1 | 1 | example1
2 | 2 | 1 | example2
3 | 4 | 1 | example4
4 | 3 | 1 | example3
1 | 1 | 2 | example1
2 | 2 | 2 | example2
3 | 4 | 2 | example4
4 | 3 | 2 | example3
See how they are unordered I want them ordered like so:

Code:
1 | 1 | 1 | example1
2 | 2 | 1 | example2
4 | 3 | 1 | example3
3 | 4 | 1 | example4
1 | 1 | 2 | example1
2 | 2 | 2 | example2
4 | 3 | 2 | example3
3 | 4 | 2 | example4
Thats how I want them outputted, ordered by the season first then order by the episode id in ASC
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote