Hi all
Had setup a dynamic table query displaying all my fields correctly...
one of the fields is:
<td bgcolor="#CCCCCC"><?php echo $row_rsParts['PB']; ?></td>
the values of the column field 'PB' is either yes or no.
how do i make it display 'yes.gif' if the value is yes and 'spacer.gif' if the value is no.
Would appreciate if fellow friends could help me out and give me some pointers. Many thanks.
Display image with value
Moderator: General Moderators
- phazorRise
- Forum Contributor
- Posts: 134
- Joined: Mon Dec 27, 2010 7:58 am
Re: Display image with value
weblearner wrote:Hi all
Had setup a dynamic table query displaying all my fields correctly...
one of the fields is:
<td bgcolor="#CCCCCC"><?php echo $row_rsParts['PB']; ?></td>
the values of the column field 'PB' is either yes or no.
how do i make it display 'yes.gif' if the value is yes and 'spacer.gif' if the value is no.
Would appreciate if fellow friends could help me out and give me some pointers. Many thanks.
Code: Select all
<?php if($row_rsParts['PB']=='yes')
$img='yes.gif';
Elseif ($row_rsParts['PB']=='no')
$img='spacer.gif'; ?>
<img src='<?php echo $img; ?>' >-
weblearner
- Forum Newbie
- Posts: 20
- Joined: Wed Dec 29, 2010 9:01 am
Re: Display image with value
hey phazorRise
many thanks for helping, had followed your code and it works.
many thanks for helping, had followed your code and it works.