在codeigniter中插入重复的数据代码

时间:2014-04-28 10:26:26

标签: php sql arrays database codeigniter

我试图在数据库中插入数据,但每次我的脚本运行其插入重复数据的数据已经存在 - 我的代码在codeigniter ..

$data = array(
               'user_id' => $user_id,
               'webid' => $webid,
               'webname' => $webname,
               'order_id' => $order_id,
               'buyer_name' => $first_name,
               'product_name' => $item_name,
               'purchase_date' => $purchase_date,
               'order_status' => $order_status,
               'shipping_name' => $first_name,
               'shipping_email' => $email,
               'shipping_street1' => $company,
               'shipping_street2' => $street_1,
               'shipping_street3' => $street_2,
               'shipping_cityname' => $city,
               'shipping_state' => $state,
               'shipping_phone' => $phone,
               'shipping_postalcode' => $zip,
               'country' => $country,
               'print_status' => $print_status

            );


$this->db->insert('orders', $data); 

任何想法都会很有意义!

0 个答案:

没有答案