Posted by bokke on 10/30/06 18:06
Hi,
I have a page that has several stories that run on it from a mysql
database. Right now I use this code:
<img src="Images/NewsPics/<?php echo $row["id"];?>.jpg" border="1"> to
display the image.
BUT I have added a column to the database with 1 or 2 (1=has pic, 2=no
pic). I would like to use an IF STATEMENT - so that:
<?php
if (<?php echo $row["PicNumber"];?> == "2") {
echo "";
} else {
echo "<img src="Images/NewsPics/<?php echo $row["id"];?>.jpg"
border="1">";
}
?>
But I can't seem to embed the <?php echo $row["PicNumber"];?> within
the PHP statement.
What am I doing wrong here? Any help would be much appreciated
Thanks
[Back to original message]
|