I want to list all the countries (147 in total) per continent with the
quantity of beercoasters that each country has. I get the following
message:
Fatal error: Maximum execution time of 30 seconds exceeded in
C:\wampp2\htdocs\main1.php on line 88
Here is the code...perhaps the loop is too big?
......
$contador = count($countries); //quantity of countries
for ($j=0; $j<$contador; $j++) {
$auxi= $countries[$j][0]; // I process each country
$count_coasters = mysql_query("SELECT COUNTRY_CODE FROM COASTERS");
$count =0;
while ($row = mysql_fetch_array($count_coasters, MYSQL_ASSOC)) {
$coasters[$count][0]=$row[0];
$count=$count+1;
}
$contador1 = count($coasters);
$acum=0;
for ($k=0; $k<$contador1; $k++) {
if(($coasters[$k][0])==$auxi) {
$acum=$acum+1;}
}
}
On the other side, if I write something like:
mysql_query("SELECT COUNTRY_CODE FROM COASTERS WHERE COUNTRY_CODE =
$auxi")
in order to get only the coasters from a country and avoid the seconf
loop (with acum) I receive the following message:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in ....
How can I count these records?