hello,
i am facing prob to create drop down menu using php mysql. i write a code but it showing only 1 row. i want to create a drop down menu from my database table and in drop down menu all data will be show in one drop down . please help me , Here is my code:
$result = mysql_query("SELECT * FROM members");
echo '<select>'; // start your select box before you loop kicks off
while($row = mysql_fetch_array($result)){
// now we are inside the loop so do stuff
// repeatedly until the array ends
$b=$row["login"];
echo '<option>';
echo $b++; // what for?
echo '</option>';
}
echo '</select>'; //end your select box now the loop has finished
Not sure if this is your case exactly, but often when outputting PHP as HTML elements and this do not seem as they should, go and look at the HTML Source code of the page — this will often turn up basic errors, failing to close tags etc.