Hello,
For the query below:
for($i=0; $i<=3; $i++){
$query = mysql_query(“SELECT * FROM events_usa WHERE `sdate
while ($row = mysql_fetch_array($query)) {
$aa[$i]=$row[‘title’];}}
echo “<td valign=”top” width=130> $day_num $daydisplay $aa[0] $aa[1] $aa[2] $aa[3] </td>”;
for($f=0; $f<=3; $f++)
{$aa[$f]=null;}
1-How can you make php print the time elapsed for a particular mysql query such as this one?(or is it the while loop) I will try different versions so that I minimize the time elapsing for the query, but how can I print the time elapsing? Or is it not the query but the while loop taking too long?
2-Also, how can I shorten the time for the query, do I need to separate tables for say, category_query thus avoiding one extra “WHERE” clause? Is that an effective strategy?
3-Or if I decreased the $i<=3 value to 2 instead of 3 in the “for” statement, would it mean it would effectively eliminate a quarter of a time passing because it is may be doing the query 4 times because of the for loop?
Thanks