Welcome Guest, Not a member yet? Register   Sign In
Setting Data and Time
#1

[eluser]GabrieleMartino[/eluser]
Hi,

i have troubles with the definition of the field date and inserting the data into the field. I think is a problem of setting of the default value. I set the field as DATETIME without default value. When I access from the controller i set this code

Code:
function add_chat_message($chat_id,$user, $message){
  
  $data = array(
    'message' => $message,
    'user' => $user,
    'chat' => $chat_id,
  );
  
  $this->db->set('date', 'NOW()', FALSE);
  
  $this->db->insert('chat_messages', $data);
}

Firebug is telling me i have a error internal server and the message i got is

Failed loading /usr/lib/php5/<DATE+lfs>/xdebug.so: /usr/lib/php5/<DATE+lfs>/xdebug.so: cannot open shared object file: No such file or directory

In the directory is present the folder 20090626+lfs, the folder libexec and the file maxlifetime.

Idea?
#2

[eluser]CroNiX[/eluser]
'date' is very bad for a column name, since it's a reserved word in mysql, which means you need to protect it's identifiers in the query.

Its really best to NOT use reserved words as column names.
#3

[eluser]GabrieleMartino[/eluser]
I changed the name in create_data and it works fine.

Thanks a lot.




Theme © iAndrew 2016 - Forum software by © MyBB