Welcome Guest, Not a member yet? Register   Sign In
$this->db->set()
#1

[eluser]tyuwan[/eluser]
This may seems small, but I was wonder why this doesn't work?

$this->db->set('count','count+1');
$this->db->where('id',$id);
$this->db->update('table');
#2

[eluser]WanWizard[/eluser]
Do an
Code:
echo $this->db->last_query();
and it will become clear.

'count+1' is taken as a literal and escaped. Check the manual on how to deal with this.
#3

[eluser]Crimp[/eluser]
For ref.

Code:
$this->db->set(‘count’,‘count+1’, FALSE);
#4

[eluser]tyuwan[/eluser]
Awesome, Thank you, I was wondering what was the FALSE for.




Theme © iAndrew 2016 - Forum software by © MyBB