Hi there! I'm newbie in part of PHP. Here is my code.



$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>
			while ($rows=mysql_fetch_array($result))
			<option value="<?php echo $rows['Price']?>"><?php echo $rows['CompanyName'] ?></option>
<input type="text" name="price"><br>
<input type="submit" name="submit" value="Submit"/>

Here is the code for my update php

include ("config.php");


$sql="UPDATE customers WHERE Price = '$price'";


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!


I found the solution in other forum but still Daniweb rocks! :) Thank you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.