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 Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/ 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 Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291871 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']." Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291872 Share on other sites More sharing options...
MasterACE14 Posted July 7, 2007 Author Share Posted July 7, 2007 ok, Thanks Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291874 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 Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291875 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().""); Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291877 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 Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291882 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 Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291890 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 Link to comment https://forums.phpfreaks.com/topic/58833-solved-mysql-query-syntax-error/#findComment-291893 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.