Posted by FRANCK
2014-07-30

Hello there,

In template 'tpl.customers.search.inc' I want to make an image appear only if the field 'video' in my SQL database is not empty.

The code below works correctly and displays fine and well when the image field of the SQL database contains information ...

BUT ... it fails to identify the scope of the SQL database when it is empty (null?) And therefore does not show the picture!

Thank you for your help


<td style='text-align:center;'>
<?php
$varvideo=$hm->Zb('rs:def:video');
if ($varvideo==""){
} else {?>
<A HREF="<?php echo $hm->Zb('rs:def:video'); ?>" target="_blank"><img src="btn_icon_play.gif"></img></a><?php
}
?>
</td>
Posted by Tom
2014-07-31

When the value is null hm->Zb('rs:def:video'); may return "&nbsp"
Would check what it returns with the following code?
echo hm->Zb('rs:def:video');