Jump to content

Display Dropdown, Only If Populated?


wright67uk

Recommended Posts

I'm looking to put an existing mysql populated dropdown list on my page.

I don't want the dropdown to display if it contains no results.

 

Am I right in thinking that I should...

 

Run the sql query

Count the results

Echo the dropdown menu within an if statement

 

Eg. If results 1 or more then echo dropdown

 

Am I on the right track? Or should I be looking at js?

Link to comment
https://forums.phpfreaks.com/topic/272540-display-dropdown-only-if-populated/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.