// Run the update query $this->CI->db->where('session_id',$this->userdata['session_id']); $this->CI->db->update($this->sess_table_name,array('last_activity' => $this->userdata['last_activity'],'user_data' => $custom_userdata));
我在CodeIgniter中使用会话时遇到问题.我下载了de las CI版本,我必须修改很多东西才能使它工作,但是,当我尝试登录我的网页时,我遇到了这个问题,有1064错误MysqL:
You have an error in your sql Syntax; check the manual that
corresponds to your MysqL server version for the right Syntax to use
near ‘SETlast_activity
= 1430854831,user_data
=
‘a:8:{s:9:\”user_data\”;s:0:\”\”‘ at line 1UPDATE SET
last_activity
= 1430854831,user_data
=
‘a:8:{s:9:\”user_data\”;s:0:\”\”;s:10:\”id_cliente\”;s:1:\”2\”;s:4:\”name\”;s:14:\”Martín
Sosa\”;s:8:\”lastName\”;s:6:\”Plaz\”;s:9:\”lastName2\”;s:4:\”Loah\”;s:15:\”numberExpedient\”;s:5:\”00002\”;s:5:\”email\”;s:27:\”mart94@hotmail.com\”;s:3:\”rol\”;s:1:\”1\”;}’
WHEREsession_id
= ‘6b4cceb3679bdc63a4534c6be0efd54f’Filename: libraries/Session.PHP
Line Number: 289
解决方法
update TABLE_NAME set ...
是否正确设置了$this-> sess_table_name?
检查您的配置文件:
$config['sess_table_name'] = 'ci_sessions';
另外,查看手册:
http://www.codeigniter.com/userguide3/libraries/sessions.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。