View Single Post

  #2 (permalink)  
Old 05-09-2008
tommybiegs@gmail.com
 
Posts: n/a
Default Re: show image when a field value = 1

On May 9, 10:28*am, "canaj...@gmail.com" <canaj...@gmail.com> wrote:
> I am trying to get a script to show a particular image when a field
> value = 1, otherwise it will show something else, and this is what I
> came up with:
>
> $i=0;
> while ($i < $num) {
>
> $name=mysql_result($result,$i,"name");
> $date=mysql_result($result,$i,"date");
> $status=mysql_result($result,$i,"status");
>
> echo "<b>$name</b>
> <br><b>$date</b><br> ";
>
> if (status == 1) {
> * * * * * * * * * echo <img src='../images/yes.jpg'>
> * * * * * * * * *} else {
> * * * * * * * * * echo <img src='../images/no.jpg'>
> * * * * * * * * *}
>
> ;
>
> $i++;
>
> }
>
> and nothing shows up, if I remove the if clause then I get the text
> showing name and date. *What am I doing wrong, aside from not really
> knowing how to program php?
>
> Thanks


if ( status == 1 )

is not the same as

if ( $status == 1 )
Reply With Quote