I was wondering if someone could tell me why when this script pulls the required information from my users table it does not alternate the colours of each row...
<?php
include_once('../includes/admin_header.htm');
require_once('../../mysql_connect.php');
$result = mysql_query("SELECT * FROM users WHERE user_id >= '1'");
echo '<table width="210" border="0" align="center" cellspacing="2" cellpadding="4">
<tr><td align="center"><b>User ID </b></td><td align="left"><b>First Name </b></td><td align="left"><b>Last Name </b></td</tr><td align="left"><b>E-mail Address </b></td</tr>';
$bg = '#eeeeee';
while ($row = mysql_fetch_array($result))
{
$bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee');
echo '<tr bg color="', $bg, '"><td align="center">',$row['user_id'], '</td><td align="left">',$row['first_name'], '</td><td align="left">', $row['last_name'], '</td><td align="left">',$row['email'], '</td></tr>';
}
mysql_close();
include ('../includes/admin_footer.htm');
?>
Any ideas? all this is doing is making the table and putting the information into it...
Any help would be great thanks 😃!