i have in one table two fields (title, content) and i inserted some values…:
+--------------------------------------+--------------------------+
| title | content |
+--------------------------------------+--------------------------+
| hello word | this is my first content |
+--------------------------------------+--------------------------+
| smoke Smoking is bad for your health | But i love it |
+--------------------------------------+--------------------------+
if I add a auto_increment field called ID, the previously input values take ID = 0:
+---+--------------------------------------+--------------------------+
|ID | title | content |
+---+--------------------------------------+--------------------------+
| 0 | hello word | this is my first content |
+---+--------------------------------------+--------------------------+
| 0 | smoke Smoking is bad for your health | But i love it |
+---+--------------------------------------+--------------------------+
and i need this:
+---+--------------------------------------+--------------------------+
|ID | title | content |
+---+--------------------------------------+--------------------------+
| 1 | hello word | this is my first content |
+---+--------------------------------------+--------------------------+
| 2 | smoke Smoking is bad for your health | But i love it |
+---+--------------------------------------+--------------------------+
The only way to set correct ID to old values is php+foreach? or i forgot something to do with sql/mysql to takes faster and automatically the correct ID values?
Thanks for help.
Well,now its my time to help you :P.
You puts SQL code in a php page or in phpmyadmin online code editor? Sometimes phpmyadmin online editor fails, try it in your php page and it works fine.