![]() | |||||||
PHP/MySQL: How to sort with custom rank settings How to sort with custom ranks? Ex: I have 1 2 3 4 And I want to update the ranks to 1 3 2 4, how would I update this? Using move up and down? Thanks, AzN |
how are they stored? How are you determining which order they should be in? |
well you should have a key field with ID and then probably another field of "rank" which are numbers which you probably update manually or whatever. just add ORDER BY rank ASC at the end of your sql statement and it'll order them for you. don't bother moving the entries aruond, cuz that'll take wayyy too many resources, especially if u get a large db. edit: actually, after rereading your post, i think the proper sql command you're looking for is UPDATE. make sure you have a primary key field of id which autoincrements or w/e and then u can do an UPDATE command. google the exact syntax, i never get it perfectly right... |
| All times are GMT -7. The time now is 02:34 PM. |
Powered by: vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0