mrp101 Posted February 27, 2010 Share Posted February 27, 2010 Hi I'm having problems with a For loop for ($i=1; $i<=10; $i++). It terminates after 3 loops while i is still = 3. Any suggestions? TIA mrp Quote Link to comment https://forums.phpfreaks.com/topic/193568-for-loop-terminating-unexpectedly/ Share on other sites More sharing options...
harristweed Posted February 27, 2010 Share Posted February 27, 2010 whats in the loop? Quote Link to comment https://forums.phpfreaks.com/topic/193568-for-loop-terminating-unexpectedly/#findComment-1018966 Share on other sites More sharing options...
mrp101 Posted February 27, 2010 Author Share Posted February 27, 2010 It reads data from one dbase, uses the data to search on another then writes the result to the first. It seems to be breaking before the while statement; $Query3 = "SELECT f1, f2, MATCH (f1) AGAINST ('".$t."') AS SCORE FROM table2"; $Result3 = mysql_query ($Query3, $Link); While($Row3 = mysql_fetch_array ($Result3)) { $scores[] = $Row3[sCORE]; } Quote Link to comment https://forums.phpfreaks.com/topic/193568-for-loop-terminating-unexpectedly/#findComment-1018978 Share on other sites More sharing options...
harristweed Posted February 27, 2010 Share Posted February 27, 2010 I can't see where you are using $i in the loop content. Something in the loop must be terminating the for loop. Do you get any error messages? ini_set('error_reporting', E_ALL); ini_set('display_errors', 'On'); Quote Link to comment https://forums.phpfreaks.com/topic/193568-for-loop-terminating-unexpectedly/#findComment-1018984 Share on other sites More sharing options...
mrp101 Posted February 27, 2010 Author Share Posted February 27, 2010 Thanks for the error message code. Problem seems to be the error below. Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/phpscript/opendb8.php on line 49 Line 49 is: While($Row3 = mysql_fetch_array ($Result3)) Some kind of timeout on the dbase query ?? Quote Link to comment https://forums.phpfreaks.com/topic/193568-for-loop-terminating-unexpectedly/#findComment-1019001 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.