Forum Moderators: coopster
Lets say, for example that I have 4 columns in my recordset:
id, event_name, event_location, event_charge
Now, I want to query the table and display the records with dynamic text on a page like so:
Event Name: User Group Meeting
Event Location: Hawaii
Event Charge: $100
If there is no value in the event_charge field, I'd like to not display either the event_charge value or the "Event Charge:" label on the page, because it's just not needed. I have been able to figure out how to not show the entire row if something is blank, but can anyone point me in the correct direction for not showing a particular column of a row? I'm using PHP.
I have been attempting to do this with an if statement, but so far that hasnt worked out.
Does this make sense?
Thanks,
Chris
This would go inside the loop where you're iterating through the results. The var $result_array is derived from the mysql_fetch_array() function:
$result_array = mysql_fetch_array($resourceid);