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 Quote Link to comment 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 Quote Link to comment 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");?> Quote Link to comment 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");?> Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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# Quote Link to comment Share on other sites More sharing options...
sstangle73 Posted January 25, 2008 Author Share Posted January 25, 2008 yeah that worked thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.