Quote:
Originally Posted by Nightfire
It won't work as there is no such colour called 'state-xxxx'.
This is a css problem, not a php one.
PHP Code:
<span class='color:state-".$player[1]." '>
|
Yes, I realized after I posted, I still need to use the class to get the color. But unfortunately, even though it looks correct to my rookie eyes, the below is still not working correctly.
The query is accurate. It gets and echos the player name fine. Just no css to go with it.
PHP Code:
$sql = 'SELECT player, state FROM game_'.$game['id'].' WHERE state != \'inactive\' AND state != \'initial\' AND state != \'dead\' AND state != \'waiting\' AND id != 1';
$player = get_array($sql);
if ($player[0] == $_SESSION['player_name']) {
echo "<span class='state-".$player[1]." '>".$player[0]."</span>";
} else {
echo $player[0];
break;