Jump to content
Sign in to follow this  
Twango

Why on earth is this generating a 504 error?

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...