Skip to content
Advertisement

How do I increment a value with mysql update query (php)

I have a query that looks like this:

JavaScript

I want to increment the value as easily as possible.

I have tried:

JavaScript

I don’t get error messages, but the value in my db does not increase either.

Advertisement

Answer

JavaScript

If you use the single quotes ', you’re telling the enclosed value to be interpreted as a string You were probably thinking about the tick marks. This is also valid:

JavaScript

This must be used when the column (or table etc.) has a reserved name.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement