Direct sum by SQL query

1

I would like to know if I have a simple sum directly through the query, I have a table that contains a sub-table named VIEWS and I would like every query that I executed these VIEWS to increase +1 without having to exercise much PHP, how can I do this?

    
asked by anonymous 05.06.2014 / 04:36

1 answer

7

Assuming the table has a field named contador and it is incremented:

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

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

    
05.06.2014 / 04:40