Newbie here. :xbones:
I want to create 2 drop down menus populated from mySQL data. User chooses an option from each menu, clicks "SUBMIT" and the chosen variables get passed to another .php page for more work.
There seems to be about 10 different wants to populate a drop down, I haven't found one that seems to actually apply to what I'm trying to do (which seems really straight forward... but what do I know? 😃)
I'm guessing I need to use $_POST[variable] but no idea where to put it or...
Functioning but won't-actually-do-anything code:
<?php
include 'config.php';
include 'opendb.php';
$query="SELECT egg_ID, egg_name FROM egg_core WHERE egg_anger='1'";
$result = mysql_query ($query);
echo "<select name=category value=''></option>";
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[egg_ID]>$nt[egg_name]</option>";
}
echo "</select>";// Closing of list box
$query="SELECT egg_ID, egg_name FROM egg_core WHERE egg_anger='2'";
$result = mysql_query ($query);
echo "<select name=category value=''></option>";
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[egg_ID]>$nt[egg_name]</option>";
}
echo "</select>";// Closing of list box
?>
May I have a shove in the right direction?