sstangle73 Posted January 25, 2008 Share Posted January 25, 2008 is there a way to order a sql query by COL--LTC--CPT--1LT--SGT Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/ Share on other sites More sharing options...
priti Posted January 25, 2008 Share Posted January 25, 2008 will you tell me what is COL--LTC--CPT--1LT--SGT. sorry for been so stupid to ask you this. thanks Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/#findComment-448648 Share on other sites More sharing options...
darkfreaks Posted January 25, 2008 Share Posted January 25, 2008 <?php $rank= array(COL,LTC,CPT,1LT,SGT) array_multisort(SORT_ASC,SORT_STRING,$rank); mysql_query("INSERT INTO table VALUES (1,2,3) ODER BY $rank");?> Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/#findComment-448661 Share on other sites More sharing options...
darkfreaks Posted January 25, 2008 Share Posted January 25, 2008 Actually this will work better: <?php mysql_query("INSERT INTO table VALUES (COL,LTC,CPT,1LT,SGT) ODER BY ASC");?> Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/#findComment-448662 Share on other sites More sharing options...
sstangle73 Posted January 25, 2008 Author Share Posted January 25, 2008 there just military ranks i already have stuff in the db im wondering how to display it in a query. Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/#findComment-448886 Share on other sites More sharing options...
revraz Posted January 25, 2008 Share Posted January 25, 2008 Use a ID number ID | Rank 1 | Gen 2 | Col etc Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/#findComment-448891 Share on other sites More sharing options...
sstangle73 Posted January 25, 2008 Author Share Posted January 25, 2008 so your saying when i add it do another colome RANK# Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/#findComment-448991 Share on other sites More sharing options...
sstangle73 Posted January 25, 2008 Author Share Posted January 25, 2008 yeah that worked thanks Link to comment https://forums.phpfreaks.com/topic/87711-solved-order/#findComment-449002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.