2016-09-11 57 views
-1

需要你的幫助,MySQL的錯誤語法附近「@points

這是錯誤的完整信息:

[SQL]: DB error - 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 '@points 

現在,這是我的SQL代碼

query_sql("UPDATE `cp_v4p_voters` SET `points` = ([email protected] - " + [email protected] + ") WHERE account_id = '" + [email protected]_id + "'"); 

謝謝你的幫助!

+0

背後有什麼@point之前使用點的原因是什麼? –

回答

0

我認爲它應該更像

<?php 
    $query_sql=("UPDATE `cp_v4p_voters` SET `points` = ([email protected] - " +  [email protected] + ") WHERE account_id = '" + [email protected]_id + "'"); 
?> 

但你似乎用+和要。和 - 不知道你想要實現什麼可能給我從cp_v4p_voters一些行的sql轉儲和更多的解釋

0

您的列points是一個文本列。所以你需要在你的價值附近使用單引號''。例如,而不是col=(val)你需要col=('val')

query_sql("UPDATE `cp_v4p_voters` SET `points` = ('[email protected] - " + [email protected] + "') 
WHERE account_id = '" + [email protected]_id + "'");