How To Do A Select And Update In One Query In Mysql Database
- Forums
- MySQL
- How To Do A Select And Update In One Query In Mysql Database
i wrote this to show people in this forums how they can select and update at the same time with php in s single query on their mysql database [915], Last Updated: Sat May 18, 2024
juvan
Wed Jan 28, 2009
3 Comments
6322 Visits
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"