Cant get result from dynamically populated drop down list
Posted: Sat Sep 06, 2008 2:55 am
I am using a drop down list which is dynamically populated from mysql succesfully with the following code
<select name="user" id="user">
<?php
while ($row = mysql_fetch_array($query)) {
echo "<option value=\"".$row['id']."\">".$row['username']."\n ";
}
?>
</select>
My problem is that when i use $username = $_POST['user']; to get the result from the list its empty.
What am i doing wrong?
<select name="user" id="user">
<?php
while ($row = mysql_fetch_array($query)) {
echo "<option value=\"".$row['id']."\">".$row['username']."\n ";
}
?>
</select>
My problem is that when i use $username = $_POST['user']; to get the result from the list its empty.
What am i doing wrong?