oldBastard
Expert Member
Hi
Need some help on a PHP/MySQL query result on a submit form. I have created a dropdown menu fetching the data from a table. When the user select the code it must fill in the description in the text area automatically. Now here is my problem, or stumbling block, how the hell.
HELP
Need some help on a PHP/MySQL query result on a submit form. I have created a dropdown menu fetching the data from a table. When the user select the code it must fill in the description in the text area automatically. Now here is my problem, or stumbling block, how the hell.
HELP
Code:
<td><select name="scode1">
<option>Please Select Code...</option>
<!-- Drop down -->
<?php
$username = "username";
$password = "password";
$db = "db";
$link = mysql_connect(localhost,$username,$password);
@ mysql_select_db($db) or die("Could not connect to the desired database.");
$cquery = "SELECT DISTINCT code FROM spareParts";
$cresult = mysql_query($cquery) or die(mysql_error());
while($row = mysql_fetch_array($cresult)){
echo '<option value="' .$row['code']. '">'. $row['code']. '</option>' ;
}
?>
</select></td>
<td><input type="text" name=descrition1></td>
<td><input type="text" name="quantity1"></td>