Posted by Andy Hassall on 10/30/06 18:14
On 30 Oct 2006 10:06:04 -0800, "bokke" <micrest@gmail.com> wrote:
><?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
You're already in PHP, so you don't need another <?php tag; you don't want to
be trying to print PHP code into other PHP code, it really just does not work
like that.
Surely you mean:
<?php
if ($row['PicNumber'] == '2')
{
echo '';
}
else
{
echo '<img src="Images/NewsPics/' . $row['id'] . '.jpg" border="1">';
}
?>
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|