This topic is locked
[SOLVED]

 Using DAL for update with 2 link fields

11/29/2011 2:04:18 PM
PHPRunner General questions
N
Nir Frumer author

Is it possible to update a table via DAL when 2 fields link the original and target table?
Global $conn,$strUpd

$strUpd = "Update stock set quantity = ".$values["quantity"]." where productID = ".$values["productID"]." And warehouseID = ".$values["warehouseID"]

Db_exec($strUpd, $conn)


how can I translate this code to DAL??
thanks in advance,
Nir.

C
cgphp 11/29/2011
global $dal;

$tblStock = $dal->Table("stock");

$tblStock->Param["productID"] = $values["productID"];

$tblStock->Param["warehouseID"] = $values["warehouseID"];

$tblStock->Value["quantity"] = $values["quantity"];

$tblStock->Update();