I have a table name tbl_material:
material | description
1000 | Samsung
2000 | Iphone
i write the code below to get material field into drop down list of HTML
require ("con_config.php");
$select_material_code = "SELECT material, description FROM tbl_material";
$get_material_code = mysqli_query ($con, $select_material_code);
$options_material_Code = "--Select Product--";
$option_material_description = "";
while ($result_material_code = mysqli_fetch_array($get_material_code))
{
$options_material_Code = $options_material_Code."<option>$result_material_code[1]</option>";
}
Here is HTML
<select name="materialcode_1" id="materialcode_1">
<option value = "<?php echo $options_material_Code;?>"><?php echo $options_material_Code;?></option>
</select>
I have a textbox:
<input type="text" name="description_1" placeholder="Description" maxlength="40" size="40" value="" id="description_1">
I want to get description field from tbl_material if i change drop down list value. how to do it? please help....
