Jump to content

drop down menue


mattison

Recommended Posts

$sql = "SELECT * FROM `tbl` WHERE `this`='that'";
$res = mysql_query($sql) or die(mysql_error());
echo "<select name=\"name\">\n";

while($row = mysql_fetch_assoc($res)){
echo "<option value=\"$row[field1]\">$row[field2]</option>\n";
}

echo "</select>\n";

Link to comment
Share on other sites

It sounds like you want the sub menus to appear once they make a choice?  Php's not really appropriate for that.  There are many good *free* javascript snippets out there that ppl have posted for others to use that do exactly what you're talking about. 

Link to comment
Share on other sites

As said before php is not your guy for drop down menus.

Have you tried gooling "drop down menu"??

 

I suggest you use CSS to create a drop down menu from <div> tags or from <ul>'s

once you have made the menu - this site can help you populate the links with php & mysql

or whatever.

 

Do a little more work on your side and I am sure people hear will be happy to help.

Link to comment
Share on other sites

Guest
This topic is now 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.