thanks for the reply,
the problem is the condition was in the middle of the loop and output as row record to the data table, i couldn't break up the heredoc and join again.
i try to put the condition inside the loop and before the heredoc as below,
if ($pictureid == 0){
$picturecode = "";
}
else {
$picturecode = "<a href="display2.php?id=$pictureid"><img src="bphoto/thumbv_$pictureid.jpg" width="35" height="25"></a> ";
}
$Dive_list_fields .=<<<__HTML_END
<tr>
<td align = "center" width = 110 style=$colornb>
<a href="disgraph.php?id=$diverid2">$divemd</a>
</td>
<td align = "center" width = 110 style=$colornb>
$diveduration
</td>
<td align = "center" width = 120 style=$colornb>
$date
</td>
<td width = 170 style=$colornb>
$divername
</td>
<td width = 130 style=$colornb>
$location
</td>
<td align = "center" width = 70 style=$colornb>
<a href="disgraph.php?id=$diverid2"><img src="divelogo.JPG" width="35" height="25"></a>
</td>
<td align = "center" width = 140 style=$colornb>
$picturecode
</td>
<td align = "center" width = 70 style=$colornb>
$picturecode
</td>
<td align = "center" width = 70 style=$colornb>
$divehits
</td>
</tr>
__HTML_END;
try to store the whole sentence of condition on poping the image to a variable of $picturecode , but i stil do not have luck on that.
do you have any solution for me?
many appreciate for any of solutions. thank youl