dropdown menu coding

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
grudz
Forum Commoner
Posts: 68
Joined: Thu Dec 04, 2003 12:52 pm

dropdown menu coding

Post by grudz »

Hi,

I have and if statement in my </head>

Code: Select all

if ($_GET['type'] == "resto")
{
	$list1 = $row_List['food'];
}
this is not final, im just testing it.....

anyway....

then i have a dropdown menu with this code

Code: Select all

<form name="" method="post" action=""></p>
<select name="list1" class="textfield">
<?php
do {  
?>
<option value="<?php echo $list1?>"><?php echo $list1?></option>
<?php
} while ($row_List = mysql_fetch_assoc($List));
  $rows = mysql_num_rows($List);
  if($rows > 0) {
      mysql_data_seek($List, 0);
	  $row_List = mysql_fetch_assoc($List);
  }
?>
                              </select>
                            </form>
the problem i have is that the choice that the dropdown menu gives me is the same.....i have the right amount, but a repeated one.....like if the output should be "choice 1" and "choice 2", it gives "choice 1" and "choice 1"

any ideas wheres the problem with my code?

thank you in advance
Post Reply