Monday, 9 September 2013

Page wont load and server crashes during PHP while loop

Page wont load and server crashes during PHP while loop

I am trying to run a php script that says basically, whilst two cells in
my MySQL database are empty (t_trailerarrival and t_endsort), do
something.
My code is as follows:
<?php
// Start Session, include authentication and dBConnection script
session_start();
include 'dbcon.php';
include 'sql_actuals.php';
$current_time = date("G");
while($query9_row['a_trailerarrival'] == NULL && $query10_row['a_endsort']
== NULL) {
echo "Trailer Arrival";
}
The $queryx_row['abc'] are all in the sql_actuals script that is included
into this script.
For some reason, every time i run this script - my browser wont load the
result (just loads for ever) and then my website at windows azure seems to
crash and take a few minutes to restart.
Could someone please advise if there is a massively obvious error with my
script? or point me at what the possible issue could be.
Many thanks in advance.
FYI, i have tried adding a line sleep(1); so that it gave the server it
runs off a delay before having to run the program again but no luck.

No comments:

Post a Comment