Hey everyone, just need some help.
I'm doing some work for a client and he needs me to list every customer who's ordered 3 or more times. There's no value in the db like "order_count" so I need to actually run two loops through the DB to see if a customer has ordered 3 or more times. Here's what I'm getting:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/buynow/public_html/checkorders.php on line 7
Here's my code:
<center><table width="500" border="1"><tr><td><b>Customer ID:</b></td></tr>
<?php
mysql_connect("localhost","******","******");
mysql_select_db("******");
$orders = mysql_query("select * from shop_order");
while($order = mysql_fetch_assoc($orders)){
$orders1 = mysql_query("select * from shop_order where customer_id=".$order['customer_id']."");
$i = 0;
while($order1 = mysql_fetch_assoc($orders1)){
$i++;
}
if($i > 2){
echo "<tr><td>".$order1['customer_id']."</td></tr>";
}
}
?>
</table></center>