xiaodao
01-31-2010, 02:32 PM
table abc
id name qty
1 banana 2
2 apple 7
now i want to update this table and set banana qty to 2(orignianl value)+3 (new value) in one single php mysql statement, how can i do it?
i do not want to fetch the banna record first , then add the value, then update again, like that is wasting queries and affecting performance
id name qty
1 banana 2
2 apple 7
now i want to update this table and set banana qty to 2(orignianl value)+3 (new value) in one single php mysql statement, how can i do it?
i do not want to fetch the banna record first , then add the value, then update again, like that is wasting queries and affecting performance