Dear, I need to increase a field. suppose hits. I want to update the value of hits field by 1 each time a visitor views a content.
i tried this subquery
update stats set views=(select views from stats where id=3)+1 where id=3
but i saw this error message:
#1093 - You can't specify target table 'stats' for update in FROM clause
i don't want to fetch value and add 1 with it then update the database. If i can do this by a simple statement, it will be great.
Md. Zakir Hossain (Raju)
- my blog with PHP scripts, PHP Book Review and many more