我有一个小问题,将POST字段保存到MongoDB
function savedata($data){
$collection = $this->db->retail_logs;
$this->data = json_decode($data);
try {
$collection->update(
array("tradingname"=>$this->data['tradingname']),
$this->data, "date"=> date("d.m.Y"), "time"=>date("H:i:s"),"whochanged"=>$_COOKIE['CRMUIDkey']), // new lead document to insert
array("upsert" => true, "safe" => true)
);
} catch (Exception $e) {
// Something went wrong ..
}
}
对于一些共鸣,$ this->持有$ _POST的数据不想去那里我得到这个错误
Warning: json_decode() expects parameter 1 to be string, array given in /home/crmvip/public_html/system/db/mongo.php on line 294
Warning: MongoCollection::update() expects at most 3 parameters, 4 given in /home/crmvip/public_html/system/db/mongo.php on line 302
它会像tradingname=monkey&street=abc