Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]Extra apostrophe when updating DB
#1

[eluser]Jaketoolson[/eluser]
When I run the following update code, it encloses the column in extra apostraphe's.

Code:
$this->db->update('users', array('last_login' => now()), array('id' => 1));

turns to:

Code:
UPDATE `users` SET ``last_login`` = 1297786692 WHERE `id` = 1

Not sure what I'm doing wrong! Any ideas? I have the latest CI Reactor files.
#2

[eluser]Unknown[/eluser]
Nevermind, that wouldn't create the desired result.
#3

[eluser]Jaketoolson[/eluser]
Trying this approach:
Code:
$this->db->set('last_login', now());
$this->db->where('id', 1);
$this->db->update('users');

Produces the same problem.
Code:
UPDATE `users` SET ``last_login`` = 1297789342 WHERE `id` = 1
#4

[eluser]CroNiX[/eluser]
try $this->db->set('last_login', now(), FALSE);
#5

[eluser]Jaketoolson[/eluser]
So I updated my CI Reactor Core to the latest... this fixed it and I'm not sure what was different between what I checked out today vs what I checked out on the 10th. I'd still like to know what the problem was.
#6

[eluser]Basketcasesoftware[/eluser]
A bug in the core? Check the build logs for the changes to the Reactor CI.




Theme © iAndrew 2016 - Forum software by © MyBB