help with renumbering sequence in mySQL db

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dangre
Forum Newbie
Posts: 9
Joined: Fri Jan 13, 2006 5:50 pm

help with renumbering sequence in mySQL db

Post by dangre »

Hello,

I'm attempting to add a standard sequence (increments of 1) for all records meeting a given criteria. My SQL select statement would look something like this:

Code: Select all

mysql_query("SELECT * FROM myTable WHERE city='Tampa' ORDER BY recordSequence ASC")
There may be dozens of records that meet it's given criteria. So --- for every record found, UPDATE the first record with a sequence of 1, next record with a sequence of 2, etc. until the recordset is finished.

Any ideas are extremely appreciated. Thank you!!
wildwobby
Forum Commoner
Posts: 66
Joined: Sat Jul 01, 2006 8:35 pm

Post by wildwobby »

So you want numbers to be added to the MySQL db by the order it outputs?
dangre
Forum Newbie
Posts: 9
Joined: Fri Jan 13, 2006 5:50 pm

Post by dangre »

Yes, that is correct. :)
Post Reply