[advanced search]
Results from the most recent live auction are here.
22 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 07-25-2008, 11:35 PM   · #1
AzN
SI: ServiceInteract
 
AzN's Avatar
 
Location: ServiceInteract
Trader Rating: (106)
Join Date: May 2006
Posts: 2,511
NP$: 15.20 (Donate)
AzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond reputeAzN has a reputation beyond repute
Find Marrow Donors! Ethan Allen Fund Ethan Allen Fund Ethan Allen Fund Save a Life Save a Life Save a Life Save a Life Save a Life Save a Life VA Tech Memorial VA Tech Memorial VA Tech Memorial VA Tech Memorial Save a Life Save a Life Save a Life
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


Please register or log-in into NamePros to hide ads
__________________
My Portfolio: ServiceInteract
Shrink your URLs with URLShrinker.net!
For all hosting info, HostReports.com
I recommend TheHiveDesigns and Fucian Tech for web design services.
AzN is offline   Reply With Quote
Old 07-26-2008, 05:33 AM   · #2
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (47)
Join Date: Nov 2003
Posts: 4,300
NP$: 1240.15 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
how are they stored? How are you determining which order they should be in?
Peter is offline   Reply With Quote
Old 07-26-2008, 08:48 AM   · #3
nasaboy007
NamePros Regular
 
Location: mysitememberships.com
Trader Rating: (32)
Join Date: Jul 2005
Posts: 891
NP$: 4687.90 (Donate)
nasaboy007 is a splendid one to beholdnasaboy007 is a splendid one to beholdnasaboy007 is a splendid one to beholdnasaboy007 is a splendid one to beholdnasaboy007 is a splendid one to beholdnasaboy007 is a splendid one to beholdnasaboy007 is a splendid one to behold
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...
__________________
nasaboy007 is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
http://www.mobisitetrader.com/ http://www.mobisitetrader.com/ EscrowDNS
Advertise your business at NamePros
All times are GMT -7. The time now is 10:37 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0