Home Have a text from database to get a color out from what it says
Reply: 0

Have a text from database to get a color out from what it says

user1252
1#
user1252 Published in April 20, 2018, 10:47 am

Hey guys, im not good with coding so after failing to find out how from googling Im gonna try get help from the pros.

So, im just making something for fun cause im bored. I have a sql database with a table that consists of name, link and status. The status has 3 options, Permanently Banned, Temporarily Banned and Kicked.

Currently I have it like this putting font color in the code, but then it all get in red text.

while($row = $result->fetch_assoc()) {
    echo "<tr>
    <td class='text-left'> ". $row["name"]. " </td>
    <td class='text-left'> ". $row["link"]. "</td>
    <td class='text-left'><b><font color='red'> " . $row["status"] . "</font></b></td></tr>";

}

I want Permanently Banned to be in red, Temporarily Banned in orange and Kicked in green. I don't understand how to make the colors appear like that.

I appreciate any help, im still a newbie when it comes to coding so im sorry if this is a really easy solution that I failed to find :P

I also have a problem with the link, but im just gonna let it be for now, maybe I'l ask after this is fixed..

Thanks! :)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.391374 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO