I have a table where one of the values is either Yes or No. I would like to have the value represented by an image according to the value. Table is also using pagination and am using code to alternate row color. Code:
<?php
$sql = "SELECT * FROM txmit ORDER BY id ASC LIMIT $start_from, 25";
$rs_result = mysql_query ($sql);
$num_rows = mysql_num_rows($rs_result);
$query = mysql_query("SELECT * FROM txmit");
$number=mysql_num_rows($query);
`while($rows=mysql_fetch_array($rs_result)){
// If $color==1 table row color = #747E80
if($color==1){
echo "<tr bgcolor='#DBDBDB'>
<td>.$rows['pid']."</td><td>".$rows['sent']."</td></tr>
?>
The $rows[‘sent’] is the Yes or No value…how do I get it to display image based on Yes or No value.
thanks
You could do this:
If they’re really just
YesandNoyou could also use:If the image path gets a bit longer I’d agree with Blazemonger’s comment and make it more readable: