Gath Posted September 6, 2007 Share Posted September 6, 2007 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. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 6, 2007 Share Posted September 6, 2007 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 Quote Link to comment Share on other sites More sharing options...
fenway Posted September 7, 2007 Share Posted September 7, 2007 Yes, there can be another select in between... unless you're using transactions, there's not much you can do about it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.