Hi all.
I've got a problem with alternating row colors that I haven't been able to resolve... in fact I've never encountered this problem before.
My code is below:
$nhire = "SELECT * FROM pilot WHERE pilot_code = '0' AND pilot_rank = '0' AND pilot_security = '0' ORDER BY pilot_enlistment";
$nhire_result = @mysql_query($nhire, $connect) or die(mysql_error());
$nhire_num = mysql_num_rows($nhire_result);
while ($row = mysql_fetch_array($nhire_result)) {
$p_id = $row['pilot_id'];
$p_code = $row['pilot_code'];
$p_fname = $row['pilot_fname'];
$p_lname = $row['pilot_lname'];
$p_email = $row['pilot_email'];
$p_hub = $row['pilot_hub'];
$p_rank = $row['pilot_rank'];
$p_hire = $row['pilot_enlistment'];
$p_status = $row['pilot_status'];
$p_security = $row['pilot_security'];
$app_date = date('M d Y', $p_hire);
if ($row_color = mysql_fetch_array($nhire_result)) {
for ($i = 0; i < count($row_color); $i++) {
if ($i % 2) {
$bgcolor = "FFFFFF";
} else {
$bgcolor = "F8F8F8";
}
}
}
if($nhire_num != "0") {
$display_applicants .= "
<tr bgcolor=#$bgcolor>
<td width=25%><font size=2>$p_fname $p_lname</font></td>
<td align=center width=30%><font size=2>$p_email</font></td>
<td align=center width=15%><font size=2>$p_hub</font></td>
<td align=center width=30%><font size=2>$app_date</font></td>
</tr>";
} else {
$display_applicants = "
<tr>
<td width=100% colspan=4><p class=a><br><center><b>There are currently no pending New Hire Applications.</b></center></p>
</tr>";
}
}
When I attempt to view the page with this code in it, if there are more than 1 records available, I get the following error:
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/Test/includes/panel.php on line 29
Line 29 is the line :
for ($i = 0; i < count($row_color); $i++) {
I've never seen this before... and I'm stumped.
Anyone have any ideas? Thanks a lot in advance...