Direct sum by SQL query

Asked

Viewed 347 times

1

I wonder if there is a way I can make a simple sum directly by the query, I have a table that contains a sub-table called VIEWS and I would like for each query that I run these VIEWS to increase +1 without I need to exercise PHP a lot, how can I do this?

1 answer

7


Assuming the table has a field called contador and this is increased:

UPDATE minhatabela SET contador = contador + 1 WHERE pagina = (id da pagina desejada)

(Where is also there for example purposes. For more details, edit the question and add the details you need).

  • 1

    +1 for having understood the question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.