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 Link to comment https://forums.phpfreaks.com/topic/165957-menu-nav/ 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> Link to comment https://forums.phpfreaks.com/topic/165957-menu-nav/#findComment-875327 Share on other sites More sharing options...
onthespot Posted July 14, 2009 Author Share Posted July 14, 2009 cheers mate, ill try this Link to comment https://forums.phpfreaks.com/topic/165957-menu-nav/#findComment-875334 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. Link to comment https://forums.phpfreaks.com/topic/165957-menu-nav/#findComment-875337 Share on other sites More sharing options...
onthespot Posted July 14, 2009 Author Share Posted July 14, 2009 OK so $menulink = $row['column']; ??? Link to comment https://forums.phpfreaks.com/topic/165957-menu-nav/#findComment-875349 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? Link to comment https://forums.phpfreaks.com/topic/165957-menu-nav/#findComment-875352 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 Link to comment https://forums.phpfreaks.com/topic/165957-menu-nav/#findComment-875377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.