I allow a member to create new styles for a program. They can save each style to a table called style_custom. A person can have more than one style in that table and the name of each can be found in the column called name. All I want to do is retrieve all of the styles that a member has from the style_custom table and put them in a drop memu. I'm using the belowe code and it is only listing one style from the table. NOTE: the member that I am querying has ten styles, but only one is showing up in the drop menu. When a member selects an item from the drop member the program will perform a given function when submit button is pressed. This is seemingly simple but I'm having a difficult time getting it to work.
<?php
//DB connection code here....
//$member stores the member name obtained from the seesion variable. This is created when
//member logs in.... This part works fine with the rest of the program.
//Run query
$q = "SELECT name FROM style_custom WHERE member = '$member'";
$r = mysqli_query($dbc, $q);
while ($row = mysqli_fetch_array($r)) {
$val = $row["name"];
}
?>
<html>
<head>
</head>
<body>
<form>
<select name="grab">
<br /><option value="<?php echo $val ?>"><?php echo $val ?><br/></option>
</select>
</form>
</body>
</html>
Thanks,
E.A.