Hi When I am inserting data to sql database which is from a PHP web form, is there an easy way to make the values so they are added to the current value? Or would it require me to make a query to find current vales then use PHP to add them before inserting into database? Like if the record has a default value of 0 and when I insert the values I want it to go up 1. Also what about if I am inserting a value via a variable and wanting to do the same, example record currently has 33 in the database and I want to insert $rating, when the variable is = to 4. Cheers John
i think you just want the column to auto increment for you in which case you would not insert a value in the insert statement, if you are not talking about auto increment then you just need to process a add via a variable
Auto Increment. Here is a code snippet in case you need this: ALTER TABLE autoData AUTO_INCREMENT=100
UPDATE table_name SET value = value + ? WHERE id = ? Execute using $rating and $id This is exactly the sort of thing databases excel at. Any data manipulation that can be done in PHP, can be done directly in SQL.