MasterACE14 Posted July 7, 2007 Share Posted July 7, 2007 I believe I've missed out a comma or haven't put a variable into the query correctly. Heres the error I am getting: Parse error: syntax error, unexpected T_STRING in /home/ace/public_html/shadowlords/functiondebug.php on line 58 Heres the query(line 58): mysql_query("UPDATE `sl_users` SET bank=`$bank` WHERE id='".$userrow["id"]."'"); Regards ACE Quote Link to comment Share on other sites More sharing options...
MemphiS Posted July 7, 2007 Share Posted July 7, 2007 mysql_query("UPDATE `sl_users` SET `bank` = '$bank' WHERE `id` = '".$userrow["id"]."'"); You had the `` in the wrong place Quote Link to comment Share on other sites More sharing options...
MemphiS Posted July 7, 2007 Share Posted July 7, 2007 Sorry didnt see that either the ".$userrow["id"]." is wrong as well; should be; ".$userrow['id']." Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 7, 2007 Author Share Posted July 7, 2007 ok, Thanks Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 7, 2007 Author Share Posted July 7, 2007 ok, thats working now, but how can I echo the results of the query? that would be really helpful in debugging Regards ACE Quote Link to comment Share on other sites More sharing options...
MemphiS Posted July 7, 2007 Share Posted July 7, 2007 mysql_query("your query ...") or die ("MYSQL ERROR: ".mysql_error().""); Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 7, 2007 Author Share Posted July 7, 2007 I already know about that one, but i'm wondering if you can make it say "success" or something if the query executes without errors. Regards ACE Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 7, 2007 Share Posted July 7, 2007 hmm, I wonder ... $result = mysql_query($query) or die(....) ; // stops execution on failure echo "success"; // although echoing the query might be more helpful when testing Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 7, 2007 Author Share Posted July 7, 2007 ok, thanks AndyB and MemphiS. Much appreciated Regards ACE 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.