我想从我的表"users"接收数据并将其他数据插入到表"olds"中,但是我只知道如何从这里访问它:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Eixoxy_model extends CI_Model {
protected $table = 'users';
protected $table_id = 'id';
public function __construct() {
parent::__construct();
}
public function getMarketing(){
$mkt = $this->db->get_where('users', array('area' => 'marketing'));
return ( $mkt->num_rows() > 0 ) ? $mkt->result_array() : false;
}
这是我想插入其他表格的内容:
$this->Eixoxy_model->create($xy);
$xy = $this->input->post(); //I want to somehow insert $xy into table "olders"
只需包含以下内容即可添加另一个表:
protected $table2 = 'test';