Getting database entries from a combo box?
Posted: Thu Oct 05, 2006 8:57 pm
Can someone please tell me how I can get database entries from a combo box? Thanks in advance.
Here is some code that I am working with:
Here is some code that I am working with:
Code: Select all
require "config_admin.php";
echo "View products in: ";
$sql2 = mysql_query("SELECT * FROM tbl_category") or die ("Could not select the database because: " . mysql_error());
// display the categories combo box
while($row = mysql_fetch_array($sql2)){
echo "<select name=\"selectCategory\" id=\"selectCategory\" class=\"select\">";
echo "<option value=\"all\" selected>All Categories</option>";
echo "<option value=".$row[category].">".$row[category_name]."</option>";
echo "</select>";
}