Hi members,
Is there a way to get a html table to turn red if i a query is positive? The table is called state, state can be open or close, when open i want the html table to turn red is this possible?
Have a nice day UpInSmoke
ok here is my code but it is not working! what is the bug? <html><head><title>NGD Update Form</title></head> <body bgcolor= "#f1f1f1"> <? $id=$_POST['id']; $db="report"; $link = mysql_connect(localhost,xxx,xxx); if (! $link) die("Couldn't connect to MySQL"); mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error()); $result = mysql_query( "SELECT * FROM adlex WHERE state = 'open'") or die("SELECT Error: ".mysql_error()); IF ($result == open) { print "<div ID=button>"; print "<table width=150 height=23 cellpadding=0 cellspacing=0 background=images/button-metal-red.gif>"; print "<tr align='center' valign='middle'>"; print"<td align='center'>"; print "<a href='URL'>Home</a></td></tr></table>"; print "</div>"; } else { print "<div ID='button'>"; print "<table width='150' height='23' cellpadding='0' cellspacing='0' background='images/button-metal-gray.gif'>"; print "<tr align='center' valign='middle'>"; print "<td align='center'>"; print "<a href='URL'>Home</a></td></tr></table>"; print "</div>"; } mysql_close($link); ?> </body> </html>
try changing IF ($result == open) to IF ($result)
Thanks Tunage