form action dropdown help
Posted: Wed Dec 17, 2003 8:22 am
I have a dropdown that is been populated from a database table, however I don't know how to show the results....
here is my code
this is the part that is not working...
Am I using incorrect syntax??
This works fine if I use a url list
HELP!!!
here is my code
Code: Select all
<?php
$query = "SELECT catID, category from category ORDER by catID";
$result = mysql_query($query)
or die ("Couldn't execute query.");
//create form containing selection list
echo "<form action='show_category.php?$catID=['catID']' method='post'>
<select name='category'>\n";
while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<option value='$category'>$category\n";
}
echo "</select>\n";
echo "<input type='submit' value='SELECT'>
</form>\n";
?>
?>Code: Select all
<?php
echo "<form action='show_category.php?$catID=['catID']' method='post'>
?>This works fine if I use a url list
Code: Select all
<?php
$url = 'show_category.php?catID='.($row['catID']);
?>