http://www.w3schools.com/php/php_ajax_database.asp
I have been looking at this sample for a week now trying to make adjustments to change the output for a GET method to fill the forms with data from the sql drop list. I have been over snippet after snippet trying to work this out.
I have the drop list worked out which lists all the product codes in the sql, but for the life of me i have no idea how to activate the $_GET to pull to the data to the input form.
Am i going about this the right way by going through ajax or should i start looking at ASP? I just need to be pointed in the right direction.
// Option 1
$sql="SELECT * FROM `cctv` ORDER BY `cctv`.`SAPCode` ASC ";
$q=mysql_query($sql);
echo "<select name=\"q_option1\">";
echo "<option size =30 ></option>";
while($row = mysql_fetch_array($q))
{
echo "<option value='".$row['SAPCode']."'>".$row['SAPCode']."</option>";
}
echo "</select>";
?>
<form id="form1" name="form1" method="post" action="">
<label for="price">price</label>
<input type="text" name="price" id="price" />
</form>