PDA

View Full Version : Changing data in a table


Yaggles
08-13-2007, 09:37 AM
UPDATE: Oh my gosh! I just look on mysql.com and found that you are supposed to use "UPDATE" instead of "CHANGE". lol small error, darn! Well, since I can't delete this post, I hope someone else who has the same issue sees this! :) lol Thanks anyway, guys!

Hey, so as to not give away too much info, I am making a program to give and take points from users. Right now, I'm still on the giving part.

It's saying that I have improper sytax on the following mysql statement. I'm going to keep trying things to get it working, but if you know and figure it out before, that's awesome.

here's the code:
$sql = 'CHANGE users SET `points` = \'' . $givepoints . '\' WHERE fid = \'' . $friendid . '\' LIMIT 1';

And here's the error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'users SET `points` = '10' WHERE fid = '615922138' LIMIT 1' at line 1

Now I've been working with PHP and MySQL for a few years now, and I'm hoping it's not some little simple error that i've been overlooking.

Thanks again in advance! :)

guelphdad
08-13-2007, 09:41 AM
change is incorrect you want UPDATE