Hi there! I'm newbie in part of PHP. Here is my code.
<?php
include("config.php");
$sql = "SELECT * FROM customers ORDER BY CompanyName ASC";
$result = mysql_query($sql);
?>
<form name="form" method="post" action="join.php">
<select name="myOptions" onchange="document.form.price.value=this.value">
<option value>----Choose Company Name----</option>
<?php
while ($rows=mysql_fetch_array($result))
{
?>
<option value="<?php echo $rows['Price']?>"><?php echo $rows['CompanyName'] ?></option>
<?php
}
?>
</select>
<input type="text" name="price"><br>
<input type="submit" name="submit" value="Submit"/>
</form>
Here is the code for my update php
<?php
include ("config.php");
$price=$_POST['price'];
$sql="UPDATE customers WHERE Price = '$price'";
$query=mysql_query($sql);
?>
When you pick one in the list of company name the price of their service will be fetch in the textbox and I want that price to edit but unfortunately I can't update it. Any help will much appreciated within bottom of my heart. Cheers!
Regards,