I'm attempting to read results from a mysql db, determine when the result is a 1 or a 0 and then set a variable to either green.png or red.png:
$result = mysql_query("select * from ping limit 1") or die(mysql_error());
$row = mysql_fetch_array($result);
$beckton = $row['beckton'];
if ($beckton = '1'){
$beckton_status = "<img src='images/green.png' width='75px' height='75px' />";
}
else if ($beckton = '0'){
$beckton_status = "<img src='images/red.png' width='75px' height='75px' />";
}
In my table 'ping' there is a column called 'beckton' which will be either a 1 or a 0. however when i load the page, all images are set to green.png, when i can clearly see in the DB that some are 0's.
i'm then just doing this: echo "<td>Beckton</td><td>" . $beckton_status . "</td>";