【发布时间】:2015-03-23 09:33:03
【问题描述】:
我正在使用我在 laravel 中的函数有问题,似乎是数组问题,但由于两天后我无法弄清楚错误消息是什么问题
Undefined index: eventID
我的功能
public static function DeleteRow($id){
$data=DB::select("select * from InOutProducts where eventID=$id;");
$eventID=$data['eventID'];
$productID=$data['productID'];
$username=Session::get('key');
DB::delete("delete from InOutProducts where eventID=$eventID");
$row=DB::select("select sum(quantity) as total_quantity from InOutProducts where productID='$productID' and InAndOut='1'");
$PhysicalStock=$row[0]->total_quantity;
DB::update("update productsStock set physicalStock=$PhysicalStock,lastUpdateBy='$username' where productID=$productID;");`
}
【问题讨论】:
标签: php mysql arrays laravel laravel-4