更新用户的详细信息时,数据库将更新所有信息,尽管当页面刷新时,会显示以前的信息,除非用户注销并重新登录,否则它不会更新。我是 CodeIgniter 的新手。有人可以帮助我或告诉我该怎么做,我将不胜感激。提前致谢。
这是我的模型:
function updateAccount($submit_userid, $submit_phone, $submit_address, $submit_eaddress) {
$this->db->where("intMemberID", $submit_userid);
$this->db->update("tblMembers", array(
"strPhoneNumber" => $submit_phone,
"strMemberAddress" => $submit_address,
"strEmailAddress" => $submit_eaddress,
));
}
这是我的控制器:
class UpdateController extends CI_Controller {
public function updateAccount() {
$this->load->model('userModel');
$data['userdata'] = $this->session->userdata('userobject');
$submit_userid = $this->input->post('userid');
$submit_phone = $this->input->post('phone');
$submit_address = $this->input->post('address');
$submit_eaddress = $this->input->post('eaddress');
$this->userModel->updateAccount($submit_userid, $submit_phone, $submit_address, $submit_eaddress);
$this->load->view('updateView', $data);
}
}