View Full Version : How does code process?

08-20-2007, 11:01 PM
This is sort of a general question, as I'm not 100% sure of the answer.

Exactly in what process/order does the php code in a script get processed? I ask this as I have a simply gaming site, and things have been going until just recently, the cause being........

I have user playing that is on dial up......and its killing me.

Since this user is on dialup, he is constantly either timing out, or getting dropped/losing his internet connection.

And the result is that I am getting sql errors on queries that can't process because the code didn't complete before he was dropped.

I'm still a newbie coder, but is there something I can do on my end, to place any checks in my code, etc?

08-20-2007, 11:07 PM
The script code is interpreted from the top down and left to right.

If your script is timing out then there is likely a problem. You can put in some print statements at key locations like inside your user defined functions or after library function calls such as queries to your database and such to narrow down the problem.

08-20-2007, 11:07 PM
PHP is a procedural language, it processes from beginning to end. It starts at the beginning and keeps going to it gets to the end. Your user's connection speed does not affect your serverside processing at all - its on the server.
You could try turning on output buffering to prevent anything being sent to him before the code has finished executing

Theres also some server keep-alive settings you could fiddle with but I can't remember whether its an apache or php setting off the top of me head

08-21-2007, 04:02 AM

thats kinda what I thought. All of my users except this one individual all use high speed, and everythings been good for months.

Now, I have this one user on dialup, and twice today, when he was completing his play, he lost his connection, and it appeared all of the php code didn't process.

I'll have to try and watch it more carefully, and see if it is something in my code than. But then again, everything has been good for months with everybody else, so just have to wait and see what happens.