Thanks guys! That worked like a charm.
I'm left with one issue I can't work out. I've used if / else if to see if the user is loged in.
If the user is not loged in and an email address has been entered in field, show text: login to view.
If the user is not loged in and an email address has not been entered in field, show text: Not available.
If the user is loged in and an email address has not been entered in field, show text: Not available.
It doesn't seem to understand that it should show ''not available'' when a user isn't loged in and an email does not exist in the database field. It simply shows no warning text at all.
Same issue with a loged in user and no email address in the database field.
the red lines are causing trouble.
What am I doing wrong here?