Home » Php » How do you do multiple SQL statements in one mysql_query?

How do you do multiple SQL statements in one mysql_query?

Posted by: admin October 29, 2018 Leave a comment

Questions:

Say I wanted to do UPDATE table SET name = 'bob' and UPDATE table SET age = 55 WHERE name = 'jim' how do I do them in the same mysql_query()?

EDIT: Since this question has a fair amount of views I’d like to point out that as of PHP 5.5 mysql_query and other mysql_* functions are now deprecated and shouldn’t be used.

Answers: