mysql - What happens in the following PHP script when several calls come in close together -



mysql - What happens in the following PHP script when several calls come in close together -

this going daft question , have googled struggled find clear answer.

i have php script on server, actual script insanely simple, sits on top of mysql database.

it receives http post messages containing combination of strings , video files.

i'm reading info $_post['']

now i'm wondering is: if create phone call server script ran, takes set amount of time.

what happens if phone call server made before previous set amount of time completed? understanding script loaded , have 2 running simultaneously. correct? if happens in next example.

message 1 comes in data. php script starts running , reads 2 of info bits in message body. message 2 comes in , new php script launched. (so have 2 scripts running, script 1 reading info message 1, , half way though processing data, , script 2 beginning). happens in $_post[''] in first script? go on read info message 1 or message 2 has been received read info that?

although different above question kind of related.

i mentioned i'm interfacing sql database, using next

$con=mysqli_connect("example.com","peter","abc123","my_db"); // check connection $result = mysqli_query($con,"select * persons"); while($row = mysqli_fetch_array($result)) { echo $row['firstname'] . " " . $row['lastname']; } mysqli_close($con);

what happens if 2 scripts seek , access same database/table @ same time? mysql able handle it?

thanks

yes, have 2 instances of script running independently on server, each separate php thread. 2 decoupled, sec cannot read info request first, , vice versa. in reply sec question, mysql execute select queries simultaneously.

php mysql

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -