MYSQL Problem

Posted on Wednesday 16th May 2007 at 11:09 PM
Diablosblizz
Diablosblizz's Avatar
Lets get right to it:

Code
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 'FROM members WHERE username = 'Diablosblizz'' at line 1


Heres my code:

PHP Code
  1. $cgc = mysql_query("UPDATE money SET money = '$getcm' FROM members WHERE username = '$checkuser'") or die (mysql_error());

** I have defined the variables

I was wondering what the heck did I do wrong!?

Thanks!
Posted on Thursday 17th May 2007 at 05:37 AM
SkillMaster
SkillMaster's Avatar
Change the code to...
Code
$cgc = mysql_query("UPDATE money SET money = '$getcm' WHERE username = '$checkuser'") or die (mysql_error());


Because you're doing two commands in one query not allowed or something like that but there ya go.
Posted on Thursday 17th May 2007 at 03:21 PM
Diablosblizz
Diablosblizz's Avatar

Table 'diablosb_users.money' doesn't exist



Thats what I get when I do that mysql query you gave me :(.
Posted on Thursday 17th May 2007 at 07:25 PM
ShadowMage
ShadowMage's Avatar
if mems is your table, is there a field named 'money' in it?

though you can change it as you know :P

If so try:

[code]
$cgc = mysql_query("UPDATE mems SET money = '$getcm' WHERE username = '$checkuser';"); or die(mysql_error());
failure i sense
Posted on Thursday 17th May 2007 at 07:38 PM
Diablosblizz
Diablosblizz's Avatar
Fixed! Thanks Shadow!
Posted on Thursday 17th May 2007 at 08:57 PM
SkillMaster
SkillMaster's Avatar
Sorry I didn't know which one was your tables...
Login or register to respond to this forum topic.