Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Feb 2005
    Posts
    663
    Thanks
    5
    Thanked 14 Times in 14 Posts

    How does code process?

    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?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    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
    Last edited by NancyJ; 08-20-2007 at 10:10 PM.

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Posts
    663
    Thanks
    5
    Thanked 14 Times in 14 Posts
    ok,

    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •