Yes, the MySQL server must return data and fill out the query before PHP proceeds to the next step, assigning a return value or moving to the next line of code.
mysql_query( "INSERT INTO y VALUES (x,1)" ); mysql_query( "SELECT x FROM y WHERE z=1" ); mysql_query( "UPDATE y SET x=x+1 WHERE z=1" ); mysql_query( "SELECT x FROM y WHERE z=1" );
x will be 1, then 2, and by the time of the fourth statement, 2 will be returned in the script. It is impossible to run queries in parallel in one PHP script - this will require parallel execution or streaming use in another language (for example, Java).
source share