am newbie for PHP here i need to populate one dropdown based on another dropdownlist example,
selection of state and city.
Code: Select all
<select onchange="display_data(this.value);">
<option>Select employ</option>
<?php
mysql_connect('localhost','root','');
mysql_select_db('shoppingcart');
$query="select catid, name from category ";
$result=mysql_query($query);
while(list($id, $name)=mysql_fetch_row($result)) {
echo "<option value=\"".$id."\">".$name."</option>";
}
?>
</select>