开发者

Truncated incorrect DOUBLE value

开发者 https://www.devze.com 2023-03-03 08:29 出处:网络
I\'m currently running into a problem with an UPDATE query. What I\'m trying to run is: dbquery(\"UPDATE users SET vip_points = \'vip_points\' +\'\". $points .\"\' WHERE username = \'\". $user .\"\'\

I'm currently running into a problem with an UPDATE query. What I'm trying to run is:

dbquery("UPDATE users SET vip_points = 'vip_points' +'". $points ."' WHERE username = '". $user ."'");

$user and $points are sent via a form. I've tried echoing the re开发者_C百科sults and they come out to what I post.

Database error

Truncated incorrect DOUBLE value: 'vip_points'

So can some one please explain what's wrong with my query? It's worked on other MySQL servers. At the moment I'm using MySQL server 5.5 under Windows 2008.

Oh, and vip_points column is set as 0 by default.

Thanks.


You're quoting values you shouldn't be quoting. Try this:

dbquery("UPDATE users SET vip_points = vip_points + ". ... ." where username = '". $user ."'");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号