Hi
I have been struggling with this for a while and cant find the answer, the code below shows my else if statement everything goes fine until using the else if statement and ' . $img . ' ends up being blank.
It should be if field 4 is 0.00 then ' . $img . ' should be nothing
else if field 4 is blank then ' . $img . ' should be nothing
else there is something in field 4 then ' . $img . ' should be <img src="/images/' . ($row['field4']) . '.jpg" height ="60" border="0" ALIGN="Left" />
All 3 come up with no code at all in the place where ' . $img . ' should be
Please help
$result = mysql_query("SELECT DISTINCT `field1`, `field2`, `field3`, `field4` FROM TABLE WHERE `field1` = '$txt1' and `field2` = '$txt2'") or trigger_error(mysql_error().$sql);
while($row = mysql_fetch_array($result)){
if($row['field4'] == 0.00)
{
$img = '';
}
else
{
if($row['field4'] ='')
{
$img = '';
}
else
{
$osimg = '<img src="../'. $row['field4'].'" height ="150" border="0" ALIGN="Left" />';
}
}
echo '
<img src="../'. $row['field3'].'" height ="150" border="0" ALIGN="Left" alt="'. $row['field1'].' '. $row['field2'].'" />' . $img . '';
}
?>