Jump to content

Query between queries doubt.


Gath

Recommended Posts

Hi.

 

I know i read something about this someplace, but i looked and cant find it again.

 

The question is:

 

using PHP, i have a piece of code that does:

-query SELECT

-3 lines of code manipulating the result i got

-query UPDATE

 

The entire code takes a few ms of time to run.

 

 

Now, pretend two people are using the same file at the exact same time, is it possible for the user_B to have the SELECT in the middle of the SELECT-UPDATE of user_A?

 

I think i read someplace that the connection to hte DB would "halt" untill the entire script as run. Yes/no?

 

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/68157-query-between-queries-doubt/
Share on other sites

the script is read form top to bottom so what ever is on the top it is processed right before the script goes down.

 

@Now, pretend two people are using the same file at the exact same time, is it possible for the user_B to have the SELECT in the middle of the SELECT-UPDATE of user_A?

i guess it the algorithmic process of mysql can answer that but i guess it is SJF shortest job first

 

so if big query and small query is run on the same time small query will be run first

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.