How to sort MySQL query by two columns

Posted by user334269 on Stack Overflow See other posts from Stack Overflow or by user334269
Published on 2010-05-06T09:40:14Z Indexed on 2010/05/06 10:18 UTC
Read the original article Hit count: 168

Filed under:
|

The following is my DB data, how can I sorting it by sid and prev_sid with php/mysql!?

sid prev_sid    type
000 197         app_home    
197 198         page_teach  
198 218         page_teach  
199 211         page_step   
211 207         link        
218 559         page_step   
559 199         page_step

Result:

sid prev_sid    type
000 197         app_home
197 198         page_teach
198 218         page_teach
218 559         page_step
559 199         page_step
199 211         page_step
211 207         link

000 > 197 > 198 > 218 > 559 > 199 > 199 > 211 > 207

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql