Hi
i am new to PHP. I am using MySQl database. In my database i have a list of products which i want to dispaly in a form as a drop-down menu.
The problem is I dont know how to link my table frield to drop down menu.
Later i want to pass the selection from drop-down menu to PHP action script. How can i do that?
pls help me.
thanks in advance
drop down menus
Moderator: General Moderators
#1 query your sql statement
#2 build your form element
#3 loop through your query results
like this
#2 build your form element
#3 loop through your query results
like this
Code: Select all
$result = mysql_query("SELECT `foo` FROM `bar`");
echo "<select>";
while($array = mysql_fetch_array($result)){
echo "<option value=\"{$array['foo']}\">{$array['foo']}</option>\n";
}
echo "</select>";Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.