Hi,i need some help in ORDER BY

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Hi,i need some help in ORDER BY

Postby mekha » Sun Jun 17, 2012 3:29 am

i have 2 columns:
1)pages_id (the id's of pages 1,2,3...)
2)pages_paid(yes,no)
...
i need in my query to SELECT...FROM...WHERE...ORDERY BY:first where pages_paid='yes' and then by id...i mean: the pages_paid be first...and then to order the other products by id :S...please
mekha
Forum Contributor
 
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

Re: Hi,i need some help in ORDER BY

Postby social_experiment » Sun Jun 17, 2012 4:38 am

Have a look at example 4 on the page below
http://www.techonthenet.com/sql/order_by.php
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
social_experiment
DevNet Master
 
Posts: 2765
Joined: Sun Feb 15, 2009 12:08 pm
Location: .za


Return to PHP - Code

Who is online

Users browsing this forum: Google [Bot] and 18 guests