thefollower Posted December 7, 2007 Share Posted December 7, 2007 I have a query with a division in it but i don't know if the syntax is wrong.. no errors occur but it doesn't appear to work either: does it look right? mysql_query("UPDATE tablename SET CurrentLife=CurrentLife/2 WHERE UserID='$DefenderID'") or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 7, 2007 Share Posted December 7, 2007 but it doesn't appear to work either And, what does it "appear" to do? I woud suggest putting the division within parens: UPDATE tablename SET CurrentLife=(CurrentLife/2) WHERE UserID='$DefenderID' Quote Link to comment Share on other sites More sharing options...
Barand Posted December 7, 2007 Share Posted December 7, 2007 Syntax ok, echo $DefenderID to ensure its value is correct Quote Link to comment Share on other sites More sharing options...
thefollower Posted December 7, 2007 Author Share Posted December 7, 2007 DefenderID echo's correctly. But now i know the sytnax works that means my if statement structure is not correct! Thanks for the help guys! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.