fazlionline Posted March 5, 2009 Report Posted March 5, 2009 Hi all Is this possible with PHP to make a dropdown menu which takes its values from a database?
jlhaslip Posted March 5, 2009 Report Posted March 5, 2009 Indeed it is possible. Content management systems use Databases to list links for all the Categories and the sub-categories and articles of each of those. Download a CMS to see how it is done. Various CMS's will handle them differently, so check out a couple of them.
sjhwebdesign Posted March 5, 2009 Report Posted March 5, 2009 <?php $getcategories = mysql_query("SELECT FROM categories ORDER BY name ASC"); ?> <?php while($categories = mysql_fetch_array( $getcategories )) { ?> <?php echo $categories['name']; ?> <?php } ?>
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now