Page 1 of 1

How to join two queries?

Posted: Sun Mar 07, 2010 6:33 am
by adilmarwat2004
$query = "SELECT * FROM info";

$query2 = "UPDATE info SET qty = round(`marks`/550*100, 2)";

How i join these two queries within one query in php page.

please help.

Adil

Re: How to join two queries?

Posted: Sun Mar 07, 2010 6:39 am
by social_experiment
I dont think you can combine 2 different actions (SELECT and UPDATE) into one query.

Why would you want to join the queries?

Re: How to join two queries?

Posted: Sun Mar 07, 2010 9:27 am
by ell0bo
You won't want to do that. Just leave them as two separate queries.

However, is there as particular reason you want to have them become one?