Hey there,
I have a question on how to proceed with a mysql query.
Ok, the scenerio goes as such:
Basically, I have a list results that are displayed from a sql query and in that output, there is information that pertains to each one of the results. Now what I want to do is to display certain info within the html output based on whether or not the that value is stored within each row.
I'm assuming that I have to validate that the info exists and if so, have PHP display the data. What I'm trying to achieve is for each row result to generate (html) dynamically based on the data stored in each row.
For example, each row result would display data for a local business. If I wanted to imbed the URL of that business into a link called 'Home' I can do that easily. What if the business doesn't have a URL? What I'm doing now would still display 'Home' in the results but if the business doesn't have a link then it's still on the page. Is there a way (efficient if possible) to display 'Home' ONLY if there is a URL in the row? I was initially thinking a class could be called to handle this as I wouldn't have to check each field. Does this sound like the best approach from a design stand-point? I appreciate any feedback! Thanks.