You are here: Re: If Statement Problem « PHP Programming Language « IT news, forums, messages
Re: If Statement Problem

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация