Jump to content

Why on earth is this generating a 504 error?


Twango
 Share

Recommended Posts

This keeps generating a 504 error. while ($row = mysql_fetch_array(mysql_query("SELECT * FROM classes WHERE toclassid = '$classid'"))){echo "Yes";}The table "classes" has 8 columns, toclassid postbyuser postdate numstars reviewstructure unid isan teacherid It always gives the error: Gateway Time-outThe gateway did not receive a timely response from the upstream server or application.Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. With that code, but when I remove it, it works fine. I can't figure out for the life of me why this isn't working. Thanks a bunch

Link to comment
Share on other sites

while ($row = mysql_fetch_array(mysql_query("SELECT * FROM classes WHERE toclassid = '$classid'")))

here if you are using mysql_query() in loop it is executed every time in the loop. it is returning a reset resulset everytim and when it pass in mysql_fetch_array() it is always being true.and it is going to infinite loop.put that outside of loop

Edited by birbal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...