|
public function AddFood()
{
$this->load->library('cart');
$data = array(
'id' => $_GET["fid"],
'qty' => $_GET["qty"],
'price' => $_GET["fprice"],
'name' => $_GET["fname"],
);
$this->cart->insert($data);
var_dump($this->cart->contents());
}
aJax的,get传过来的内容我都能echo出来证明已经传过来了
但是执行插入语句$this->cart->insert($data);之后再试着打印var_dump($this->cart->contents());打印出来的内容是array(0){},为什么会插入失败呢 |
|