What is the command to use in case i would like to change the value of one field on a mysql table by number on descending order, i mean, i have a field call "number" on the table called "data" how can i set the value of "number" to:
0
1
2
3
4
each time the script is executed
thanx
UPDATING VALUES ON A MYSQL TABLE FIELD
Moderator: General Moderators
-
intercampus
- Forum Newbie
- Posts: 2
- Joined: Fri Aug 13, 2004 10:10 pm
- arcanechaos
- Forum Newbie
- Posts: 4
- Joined: Sat Aug 14, 2004 3:27 am
- Location: Long Beach, CA
- arcanechaos
- Forum Newbie
- Posts: 4
- Joined: Sat Aug 14, 2004 3:27 am
- Location: Long Beach, CA
oh, and the mysql select looks like this:
Code: Select all
mysql_query("SELECT * FROM whatever ORDER BY whatever DESC");
// or ASCE for ascending-
intercampus
- Forum Newbie
- Posts: 2
- Joined: Fri Aug 13, 2004 10:10 pm
hi
the thing is that every time i add a data to the table it's put at the bottom that i fixed it sorting the table by date putting the latest data adition in the top of the table, what i need to do is to put number "0" to that data in one field and then changing the previous one to 1 the next to 2 etc being the case that before it was added that last data the now number 1 was 0, numer 2 was 1 etc.