Welcome Guest, Not a member yet? Register   Sign In
active recorder:update table....how to?
#1

[eluser]chmod[/eluser]
my sql is below:
$sql_add_point = "UPDATE member SET totalpoint = totalpoint + '$point',lastaddpoint = '$point' WHERE username='$username'";


Code:
$this->db->set('totalpoint','totalpoint' + $point);
$this->db->where('username',$username);
$res_add_point = $this->db->update('member');


Code:
$this->db->set('totalpoint','totalpoint' + $point);

this code is wrong,but what can i do?
#2

[eluser]Armchair Samurai[/eluser]
It looks like you're trying to do:
Code:
SET `totalpoint` = `totalpoint` + 1
for example. If you're using 1.6.2, try setting the escape parameter to FALSE.
Code:
$this->db->set('totalpoint', "totalpoint + $point", FALSE);
#3

[eluser]chmod[/eluser]
thanks for your replay.




Theme © iAndrew 2016 - Forum software by © MyBB