return a value if field is not empty
Posted: Wed Apr 20, 2011 5:48 am
Would appreciate some assistance
Have pdf's uploaded to a database, want the user to be able to download/open them. Not a problem
<a href="<?php echo $row_Cal_list['entry_form']; ?>">Entry Form</a>
Works fine
Problem, I only want the link to show if there is an entry form available, if the field is empty then I would prefer it to be blank
Have this which works nicely.
<?php
if($row_Cal_list['entry_form'] != '')
{
echo $row_Cal_list['entry_form'];
}
?>
How do I put the two together, or is there a better way?
Am a dreamweaver user and obviously am no genius where php is concerned
Thanks in advance
Have pdf's uploaded to a database, want the user to be able to download/open them. Not a problem
<a href="<?php echo $row_Cal_list['entry_form']; ?>">Entry Form</a>
Works fine
Problem, I only want the link to show if there is an entry form available, if the field is empty then I would prefer it to be blank
Have this which works nicely.
<?php
if($row_Cal_list['entry_form'] != '')
{
echo $row_Cal_list['entry_form'];
}
?>
How do I put the two together, or is there a better way?
Am a dreamweaver user and obviously am no genius where php is concerned
Thanks in advance