I have a page http://www.noblemarine.co.uk/clubfinder.php3 which selects the names of the clubs from a database. Refresh the page a few (<20) times and you will see the query fails at a particular point sometimes. This generates no error message so I can't see what the problem is. The query is: $query = "select name from clubs where name!='' order by name LIMIT 1500"; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); $result = mysql_query($query) or die("failed $query failed - . mysql_error()"); while ($row= mysql_fetch_array($result)) { $name = trim($row[name]); $name2=$name; $str=$name; $length=25; $trailing='...'; $length-=strlen($trailing); if (strlen($str) > $length) { $name=substr($str,0,$length).$trailing; } else { $name = $str; } echo"<OPTION VALUE=\"$name2\">$name</OPTION>\n"; PHP:
I tried it 10 times and it was fine. Are you sending cache control headers? Maybe you're seeing a cached page when it was broken sometime in the past? Clear your browser cache and try again.
It showed a broken page once so I refreshed the page until it did it again which occurred after 20 clicks.
In your query try changing the name!='' PHP: to name<>'' PHP: Thats what works on my server but it may or may not work on yours.