PDA

View Full Version : Can somebody tell me whats wrong with this query?


daguy
09-29-2006, 12:02 AM
mysql_query("UPDATE users_rpg SET
eq$item[cat]=$id,
spent=spent-$pitem[coins]*0.6+$item[coins] WHERE uid=$loguserid")
or print mysql_error();

All $codes are explained in the file,but the only erro I get its this "*0.6"

So hmm any help?

guelphdad
09-29-2006, 01:01 AM
I think you need brackets around your math like this:
mysql_query("UPDATE users_rpg SET
eq$item[cat]=$id,
spent=(spent-$pitem[coins]*0.6+$item[coins]) WHERE uid=$loguserid")
or print mysql_error();

daguy
09-29-2006, 04:07 AM
Thanks it worked,but I had to add a (' ') not ( ) only.But thanks!