Hi,
I've got this function to make a Option Box
I'd Like to be able to pass a Variable (cat_id) to it and for that option to be selected.PHP Code:function build_options()
{
$q = "select * from cats";
$result = mysql_query($q) or die (mysql_error());
echo "<select name =\"cat_id\">";
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
extract ($row);
echo "<option value =\"$cat_id\">$cat_id - $cat_text</option>\n";
}
echo "</select>\n";
}
Any ideas?
Cheers




Bookmarks