Posted by news@celticbear.com on 08/24/07 21:19
Hello,
The following brief script takes 35 seconds to run.
If there something I might be able to do to make it run faster?
Thanks for any suggestions!
-Liam
$sql = "SELECT affiliates.accountid AS theaccount, count(ordernum) AS
thecount
FROM orders
JOIN affiliates ON (affiliates.accountid = orders.accountid)
WHERE complete = '1' AND date > '2007-07-01' AND
affiliates.accountid <> 'NULL'
GROUP BY theaccount
ORDER BY thecount desc
LIMIT 10";
$result = @mysql_query($sql);
while ($row1 = mysql_fetch_array($result)) {
$theaccount = $row1['theaccount'];
$thecount = $row1['thecount'];
$arr_msg1[] = "$theaccount : $thecount<br/>";
$arr_msg2[] = "$theaccount : $thecount<br/>";
}
foreach ($arr_msg1 as $arr_msg1) {
echo "$arr_msg1";
}
echo "<br/><br/>";
shuffle($arr_msg2);
foreach ($arr_msg2 as $arr_msg2) {
echo "$arr_msg2";
}
[Back to original message]
|