i hv 2表用户是codeigniter中的管理员(用户id,状态)、用户配置文件(学生配置文件id,用户id)更新状态
我的模型:i hv 2表用户是codeigniter中的管理员(用户id,状态)、用户配置文件(学生配置文件id,用户id)更新状态,codeigniter,Codeigniter,我的模型: function update_client1($student_profile_id,$update_data,$status) { $this->db->where('student_profile_id', $student_profile_id); $query=$this->db->update('User_Profile',$update_data); $this->db->where('status'
function update_client1($student_profile_id,$update_data,$status)
{
$this->db->where('student_profile_id', $student_profile_id);
$query=$this->db->update('User_Profile',$update_data);
$this->db->where('status',$status) ;
$query=$this->db->update('User',$update_data);
$report = array();
$report['error'] = $this->db->_error_number();
$report['message'] = $this->db->_error_message();
if($report !== 0){
return true;
}else{
return false;
}
}
我在显示中遇到以下错误:
发生数据库错误错误号码:1054
“字段列表”中的未知列“firstname”
UPDATE `User` SET `firstname` = 'minu1', `lastname` = 's12', `email` = 's@rw.m',
`phone_number` = '0123654799', `city` = 'ahmedabad', `state` = 'gujarat',
`country` = 'india', `subject_id` = '20' WHERE `status` IS NULL
文件名:C:\xampp\htdocs\ekta\example\system\database\DB\u driver.php电话号码:330
如何解决此问题?I hv update 2 table user(状态)和user_profile(所有字段)确认user table中是否存在“firstname”列显示
$update
数组和两个表的字段。
class Dashboard extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model("admin/post_model");
$this->load->model("admin/comment_model");
}
public function index(){
$data['post_res'] = $this->post_model->getPost();
$data['com_res'] = $this->post_model->getComments();
}
}