Hi,
I have a database with a rq_report field, that has a deafult value of 1, but then a script updates that value to = 2
The Database also has a rq_id field, that is autoincriminent and used to identify each post.
Bassically, I wana make a script that will read from the database, each post, then if it has a rq_report value of 1, make the table it is displayed in on the page white, and if it has a value of 2, make the table it is displayed in on the site red.
Heres some code I have :
$query = mysql_query("SELECT * FROM tm_requests");
while($row = mysql_fetch_array($query) ) { if ( $row['rq_report'] = 2 ) $color = "#ff0000" else $color = "ffffff"; }
{
$done .= "<tr><td bgcolor='$color' align='center' valign='middle'><input type='checkbox' name='request[]' value='{$row['rq_id']}''></td><td bgcolor='$color' align='center'>{$row['rq_name']}</td><td bgcolor='$color' align='center'>{$row['rq_artist']} - {$row['rq_sname']}</td><td bgcolor='$color' align='center'>{$row['rq_mess']}</td><td align='center' bgcolor='$color'>{$row['rq_ip']}</td><td bgcolor='$color' align='center'>{$row['rq_date']}</td></tr>\n";
}
if ($done == "")
{
$done .= "<tr><td bgcolor='$color' align='center' valign='middle' colspan='7' height='20'><strong></strong></td></tr>";
}
The $done code works, just the While code fails, It brings up this error :
Parse error: parse error, unexpected T_ELSE in /home/nsfm/public_html/trialist/test/test2.php on line 38
Im wondering how to edit the code above to do what I want it to
Thanks,
Craig