Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my query is here:
XML
$t1 = "(select quantity_app
        from requested
        where requested_id = $_POST[hidden])";
$t2 = "update warehouse
       set quantity = quantity - " . $t1;


this query doesn't run please help me i don't know were i do it wrong!
the quantity_app column must subtract quantity column
Posted

1 solution

At least as your code is written, you never executed the query to get a value in $t1. For that matter, you don't seem to have a connection, either.

Anyway, as written, there's no reason for $t1 to have your value. It's just a string containing a tsql query.

Not the best source, but http://www.w3schools.com/php/php_mysql_intro.asp[^] will help you get on your way.   It has an example, a few pages in, of an insert statement.

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900