Hi guys,
I've just started PHP programming and i've come up against a few blocks!
Now my issue is probably really easy to solve but i cannot for the life of me find another related topic. I've been searching on google for 1hr plus trying to find a solution so i hope you guys can help!!
I've got a list box which is populated by a MYSQL DB table. The list box is then displayed to the current id of a product. All i want is when that list box selection is changed, to be able to echo that new value out.
The code is:
$query1="SELECT foodid, foodname FROM foods";
$result1 = mysql_query ($query1);
echo '<select name="select">Foods';
while($row=mysql_fetch_array($result1))
{
echo "<option value=$row['foodid']";
if ($row['foodid'] == $f)
{
echo ' selected="selected"';
}
echo ">$row[foodname]</option>";
}
echo "</select>"; echo $_POST['select']."</td>";
Can anyone help?
Thanks
Andy