someone can tell me how to update the value from 0 to 1, 52 to 53 (value++) using php script? i want to search it on go*gle but i dunno the keyword to find it
3 Answers
You may update your auto-increment column (known as 'id') using a "update" sql in your php script using something like:
'UPDATE table_name SET id=(id + 1), [column2]=[value2], ...'
OR with PHP computed values (here $current_value):
'UPDATE table_name SET id=' . $current_value + 1 ', [column2]=[value2], ...'
The SQL update request is explained here: http://www.w3schools.com/SQl/sql_update.asp (or here: https://mariadb.com/kb/en/mariadb/update/#syntax)
2 Comments
Paper
Welcome to Stack Overflow, here we do not like W3schools links but otherwise, great answer. :)
user6815451
@4796321 oh ok. Here is the SQL update reference then: mariadb.com/kb/en/mariadb/update/#syntax (I have edited the answer in consequence).
"UPDATE table_name
SET column_name = column_name+ 1
WHERE condition";
Hope this help
1 Comment
Machavity
Please stop using mysql_ functions, as they have been removed from PHP

idcolumn? OR any other column?