Suppose I am executing several queries on the server using mysql_query. The results of every query affect the subsequent query. Will every call of mysql_query be completely executed before control moves on to the next one?
Edit: I forgot to mention, I am not using a transactional storage engine.
Yes, the MySQL server must return data and complete the query before PHP will progress to the next action, be it assigning the return value or progressing to the next line of code.
x will be 1, then 2, and by the time of the fourth statement 2 will be returned to the script. It is not possible to run the queries in parallel in a single PHP script – this would require parallel execution or threading in another language (i.e. Java).