I have an if state looking at the photo field and asking if empty to display nothing if there is something in the field display the else statement… I am missing something… Full Code below the statement
[embed=425,349]
if(empty($row[‘photo’]))
{
// it’s empty!
echo “”;
}
else
{
echo “<td class=“boxbg”> <a href=“http://www.website.com/admin/news/upload/”.$row[‘photo’].”" target="_blank" “><img src=“http://www.website.com/admin/news/upload/”.$row[‘photo’].”" width=“200” height=“200” align=“right” target="_blank">";
}
[/embed]
Full Code
[embed=425,349]<?php
ini_set (“display_errors”, “1”);
error_reporting(E_ALL);
$id = $_GET[‘id’];
$query = “SELECT * FROM news WHERE id = ‘$id’”;
$result = mysql_query($query);
while($row = mysql_fetch_array($result)) {
echo “
";”.$row[‘title’]."
echo " <table width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<td rowspan=“3” class=“boxarrow”>
<td class=“boxtopleft”>
<td class=“boxbg”><img src=“graphics/box-bg.png” alt=“240” width=“2” height=“2” />
<td width=“10” class=“boxtopright”>
<td class=“boxbg”>";
if(empty($row['photo']))
{
// it’s empty!
echo “”;
}
else
{
echo “<td class=“boxbg”> <a href=“http://www.website.com/admin/news/upload/”.$row[‘photo’].”" target="_blank" “><img src=“http://www.website.com/admin/news/upload/”.$row[‘photo’].”" width=“200” height=“200” align=“right” target="_blank">";
}
echo “”.$row[‘body’]."";
echo “”;
echo "<td class=“boxbg”>
<td class=“boxbottomleft”>
<td class=“boxbg”><img src=“graphics/box-bg.png” alt=“240” width=“2” height=“2” />
<td class=“boxbg”>
";
echo "
| Return to News |";
}
?>[/embed]