onthespot Posted July 14, 2009 Share Posted July 14, 2009 I have a drop down css menu, and am looking for the drop down to be populated by certain links from the database. Ok so say I create a table in the database which then creates a page for this table, how can i make it so all these tables are on the dropdown? Everytime a new table is created of this kind, it will list on the dropdown? Cheers Quote Link to comment Share on other sites More sharing options...
nbarone Posted July 14, 2009 Share Posted July 14, 2009 <ul> <?php $sql = "SELECT * FROM table"; $result = mysql_query($sql); while($row = mysql_query($result)){ extract($row); echo "<li>".$menu_link."</li>"; } ?> </ul> Quote Link to comment Share on other sites More sharing options...
onthespot Posted July 14, 2009 Author Share Posted July 14, 2009 cheers mate, ill try this Quote Link to comment Share on other sites More sharing options...
nbarone Posted July 14, 2009 Share Posted July 14, 2009 menu link would be the column name, btw. and you will need to format the link inside of it. Quote Link to comment Share on other sites More sharing options...
onthespot Posted July 14, 2009 Author Share Posted July 14, 2009 OK so $menulink = $row['column']; ??? Quote Link to comment Share on other sites More sharing options...
nbarone Posted July 14, 2009 Share Posted July 14, 2009 correct...the extract() function removes it soo you have "user_id" in a table $row = mysql_fetch_array($result) $row['user_id']; extract($row); $user_id got it? Quote Link to comment Share on other sites More sharing options...
onthespot Posted July 14, 2009 Author Share Posted July 14, 2009 yeah mate awesome, ill try it all out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.