- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
$this->db->insert("orders", $data);
//Get order's id
$this->db->select("orders_id");
$this->db->where('orders_customer_tel', $data['tel']);
$this->db->order_by("orders_id", "desc");
$this->db->limit(1);
$query = $this->db->get("orders");
foreach ($query->result_array() as $res) {
$orders_id = $res['orders_id'];
}