Hi
All
I want to create combo box in php which can get the values from database table.
Any help will be appreciated
Thanks
MD.Samiuddin
Hi
All
I want to create combo box in php which can get the values from database table.
Any help will be appreciated
Thanks
MD.Samiuddin
include_once('dbaseconn.php');
/*
dbaseconn.php contains;
$server = 'servername';
$database = 'database_name';
$username = 'username';
$password = 'password';
*/
//used to connect to database mysql_connect($server,$username,$password);
mysql_select_db($database);
$result = mysql_query("SELECT column_name FROM your_cable") or die(mysql_error());
if (mysql_num_rows($result)!=0)
{
echo '<select name="drop_2" id="drop_2">
<option value=" " selected="selected">Choose one</option>';
while($drop_2 = mysql_fetch_array( $result ))
{
echo '<option value="'.$drop_2['column_name'].'">'.$drop_2['column_name'].'</option>';
}
echo '</select>';