Hi memine,
you can actually edit the thread, so if you have forgotten something, just edit, instead of adding a post. Also: When you use code or php in your posts, ad:
[ p h p ] [ / p h p ] or [ c o d e ] [ / c o d e ] around your posts (Remote the spaces) as it will format is in better legible posts.
Here goes, I'd suggest to create an array with the class you would like to use for your rows (Yes, use a class, rather then a color. If at a later stage you decide to modify the look of your site, you only ave to change the class, and not the code).
// create an array with an entry for each different value
$classes = array(
'Open' => 'maintext1',
'Closed'=> 'maintext2',
'Waitlisted'=>'maintext3');
$sql="select id, program_name,program_num,fall_status from $program order by program_name";
$result=mysql_query($sql,$connection) or die(mysql_error());
$table = "<table>";
while($row=mysql_fetch_array($result)) {
// how is $fall_status defined?
// set a default class
$thisclass='maintext';
// set a value-depended class
if(isset($fall_Status) && array_key_exists($fall_Status, $classes))
{
$thisclass = $classes[$fall_Status];
}
// fill output variable
$table .="
<tr>
<td class=\"".$thisclass."\">
".$row['program_num']."
</td>
<td class=\"".$thisclass."\">
$row['program_name']
</td>
<td class=\"".$thisclass."\">
$row['fall_status']
</td>
</tr>";
}
$table .="</table>";
echo $table