⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to only show set_relation results if not null



Woodie
  • profile picture
  • Member

Posted 31 October 2016 - 11:46 AM

Hi all,

 

I am setting a relation with an address table and displaying the result multiple address column fields as such:

$crud->set_relation('address_id','address','{address_1}<br> {address_2}<br> {address_3}<br> {town}<br> {county}<br> {postcode}');

This works fine but what I would like is to only show the results of fields that are not null so I don't get breaks with null values in the output:

 

e.g.

Address line 1

 

 

Town

County

Postcode

 

 

Any help with this would be greatly appreciated

 

Thanks in advance