I getting Unknown column 'Array' in 'field list' error
i like to do is what ever random numeric inserted to invoice column i should pass it to the column transaction_num of another table.
MY CONTROLLER
$order = array(
'date' => $date,
'customer_id' => $cust_id,
'invoice' => random_string('numeric', 6)
);
$ord_id = $this->PaymentModel->insert_order($order);
$invoice = $this->PaymentModel->get_invoice($ord_id);
$order_detail = array(
'transaction_num' => $invoice,
//there is other data to be inserted here i just removed it coz this column is the only problem
);
$this->PaymentModel->insert_order_detail($order_detail);
MY PAYMENT MODEL
public function get_invoice($ord_id){
$query = $this->db->select('invoice')->from('orders')->where('serial', $ord_id)->get();
return $query->result_array();
}
public function insert_order_detail($order_detail) {
$this->db->insert('order_detail', $order_detail);
}