I'm looking for a solution. I am developing a "user profile" php file which will render to the current user their profile information. The info rendered and seperated into different divs (styled with css) will be in the form of html/php. However, if no information exists in a specific field i do not want the php echoed div to appear at all.
The way i am working this at the minute is by using mysql_num_rows, if it =='0' - no info is rendered - even if information in the other fields exist!!. This means i will have to seperate all my fields in "table1" into tables of their own, which in my opinion seems to defeat the object of a database.
I'm sure this can be done using mysql_num_fields(), then identifying which fields have information and which don't; thus enabling me to echoe out into divs only the field values of the fields which have values; thus the empty divs not being rendered to the user.
phroooah...!!! Bit of a long one but i hope this is easy enough to understand.
Any help at all with this will be great!

7 Years
Discussion Span
Last Post by Hypalink

I think i have solved this. By using if(strlen($variable)<1) echo "";(nothing!); this seems to solve the issue.

Thanks anyway.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.