0

how to execute two queries if isset
like this

but this code wont work

if (isset($_POST['Add'])){

$tror=$_POST['tror'];
$name=$_POST['name'];
$product=$_POST['product'];
$price=$_POST['price'];
$deliver=$_POST['deliver'];
$return=$_POST['return'];
$custody=$_POST['custody'];
$cash=$_POST['cash'];
$charge=$_POST['charge'];
$date=$_POST['date'];

mysql_query("insert into delivery (TrOr,Customers_Name,Product,Price,Deliver,xReturn,Custody,Cash,Charge,Date)
            values('$tror','$name','$product','$price','$deliver','$return','$custody','$cash','$charge','$date') ; UPDATE inventory set Quantity='$_POST[cquantity]' WHERE Product='$_POST[product]'");

}
4
Contributors
6
Replies
16
Views
4 Years
Discussion Span
Last Post by cereal
0

Change the semi-colon in between for a comma, make sure the column names in the first query are exactly the same as in mysql i.e same case throughout, mysql gets funny about that,
otherwise, just make the update a separate query. I'm also assuming that you have a connect earlier in the script, you don't show it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.