Jump to content

PHP Color


Escyll
 Share

Recommended Posts

Hi,I have a little problem and I hope the solution is easy :)Now i have something like this: (It's in an HTML table)$result = mysql_query("SELECT * FROM leerling");while($row = mysql_fetch_array($result)) {print "<td>"; if ($row['SOMETHING']=="leeg") { print "<font color='#FF0000'>Leeg</font>" . "</td>"; } else { echo $row['Something'] . "</td>"; <-- Now THIS line has to be green colored, now its black, if i do it } the way above, you wont see anything. }Who can help me?

Link to comment
Share on other sites

Hi,I have a little problem and I hope the solution is easy :)Now i have something like this: (It's in an HTML table)$result = mysql_query("SELECT * FROM leerling");while($row = mysql_fetch_array($result)) {print "<td>"; if ($row['SOMETHING']=="leeg") { print "<font color='#FF0000'>Leeg</font>" . "</td>"; } else { echo $row['Something'] . "</td>"; <-- Now THIS line has to be green colored, now its black, if i do it } the way above, you wont see anything. }Who can help me?
try this:
while ... {print "<td>";if($row['SOMETHING'] == "leeg") {   print "<font color='#FF0000'>Leeg</font>";   }else ($row['SOMETHING'] != "leeg") {   print "<font color='green'>Leeg</font>";   }print "</td>";} // this is closing bracket for WHILE

Link to comment
Share on other sites

try this:
while ... {print "<td>";if($row['SOMETHING'] == "leeg") {   print "<font color='#FF0000'>Leeg</font>";   }else ($row['SOMETHING'] != "leeg") {   print "<font color='green'>Leeg</font>";   }print "</td>";} // this is closing bracket for WHILE

well, this might work (change only else statement):else ($row['SOMETHING'] != "leeg") { print "<font color='green'>" . $row['SOMETHING'] . "</font>"; }
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...