Hey, I've got a simple little table that has only 3 fields. ID (primary key, auto-increment), cat_name, and cat_num.
I need to know how to get my php script to go into that table, and increase the value in cat_num by one on every row.
So for instance, here is my table:
ID cat_name cat_num
3 Music 1
5 Movies 2
6 Food 3
10 Other 4
I need a script that will change the cat_num for all those rows to be one higher than they already are. I tried using a for loop, and a while loop, but can't seem to get it to work. Anyone know an easy way to do this?
Edit, sorry, just realized the table doesn't look nice and neat like I typed it. But hopefully you get the drift.