Jump to content

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.