// 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 中使用 session 时遇到问题。我下载了 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 'SET
last_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
最佳答案
您缺少 session 表名称
update TABLE_NAME set ...
$this->sess_table_name
是否设置正确?
检查你的配置文件:
$config['sess_table_name'] = 'ci_sessions';
另外,查看手册: http://www.codeigniter.com/userguide3/libraries/sessions.html
关于php - ci_sessions 表中的 CodeIgniter 出现 1064 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30061945/