This topic is locked
[SOLVED]

 Update Query on Event

5/29/2011 2:54:45 PM
PHPRunner General questions
U
unsearcheable author

Hello, i want to update record in another table with matched id of record im adding, but how can i put actual record in sql query ? I mean, there is a variable ?
I'll try to give example:
I want to update last_sale field in items table with number of sale i am adding.

global $conn;

$strSQLUpdate = "UPDATE items SET items.last_sale = $values [sales.number] WHERE (items.id = sales.itemid )";

db_exec($strSQLUpdate,$conn);
return true;


Why isnt $values getting current record ? Isnt $values the right formula ?!

U
unsearcheable author 5/29/2011

Ok, i figured out, have to get first $_SESSION["id"] = $values["id"] .