我正在尝试更新数据库中的结果。更新查询工作正常,值正在更新但控制器始终显示其他结果。
代码
基础控制器
#update/save in model
$data = ['twitter_link' => $this->input->post('twitter_link')];
if($this->Restaurant_admin->update_site_settings($data,'setting_id',1,'site_setting')){
$this->session->set_flashdata("update_success_twitter","Twitter link updated successfully.");
redirect('admin/Entry/basic_table');
}else{
$this->session->set_flashdata("update_success_twitter","Something went wrong data not saved.");
redirect('admin/Entry/basic_table');
}
Restaurant_admin模型
public function update_site_settings($data,$where_cond,$value,$table_name)
{
$this->db->set($data);
$this->db->where($where_cond,$value);
$this->db->update($table_name,$data);
}
#update_site_settings
答案 0 :(得分:3)
在模型1. Login -> 2. Click on a specific page -> 3. crawl a specific URL
函数中检查查询是否执行,如果执行成功update_site_settings
否则return true
return false