Wallpapers Forums Login

How To Mysql Select And Update In One Query

i am learning php and mysql database, i know how to query and update in two separate quqeries, but i was wondering if its possible to do a SELECT and UPDATE in one query? like this for example

$sql = "SELECT hits FROM counter WHERE id = 23";

$sql = "UPDATE counter SET hits=24"
Cyber Tue Sep 22, 2009
update counter set hits=hits+1
justin Wed Jan 28, 2009
i will try it i dont konw if its going to work. ill let you know what i find out
dbnovice56 Wed Jan 28, 2009
have you tried this:

$sql = "SELECT hits FROM counter WHERE id = 23 AND UPDATE counter SET hits=24"

Related Content

Information

Share

wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5