Error 1064 using CodeIgniter in ci_sessions table

// 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));

I have a problem with sessions in CodeIgniter. I downloaded the las CI version and I need to change many things to make it work, but when I try to enter my website I have this problem with MySQL error 1064:

You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use near 'SET last_activity= 1430854831, user_data=' a: 8: {s: 9: \ "user_data \"; s: 0: \ "\" 'on line 1

UPDATE 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: \ "Martin Sosa \"; s: 8: \ "LastName \"; s: 6: \ "Plaza \"; s: 9: \ "lastName2 \ "; s: 4: \" Loah \ "; s: 15: \" numberExpedient \ "; s: 5: \" 00002 \ "; s: 5: \" email \ "; s: 27: \" mart94 @ hotmail.com \ "; s: 3: \" role \ "; s: 1: \" 1 \ ";} WHERE session_id= '6b4cceb3679bdc63a4534c6be0efd54f'

File Name: libraries / Session.php

Line Number: 289

+4
source share
2 answers

update TABLE_NAME set ...

$this->sess_table_name?

:

$config['sess_table_name'] = 'ci_sessions';

, : http://www.codeigniter.com/userguide3/libraries/sessions.html

+3

, :

$config['sess_table_name'] = 'ci_sessions';
$config['sess_use_database']    = FALSE;

, ...

0

All Articles