2011-08-10 48 views
2

我看不出有什麼不對這個SQL:SQL更新錯誤替換爲

UPDATE Show 
SET EnterOnine = replace(EnterOnine, 'http://projects.example.co.uk', 'http://www.example.co.uk') 
WHERE EnterOnine LIKE '%http://projects.example.co.uk%' 

我得到這個錯誤,當我進入到這個phpMyAdmin的:

#1064 - 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 'Show SET EnterOnine = replace(EnterOnine, 'http://projects.example.co.uk' at line 1 

回答

5

Showreserved word在mysql中,使用back ticks進行轉義。

UPDATE `Show` SET ...
+1

省長謝謝,我會想,MYSQL將能夠給你一個更有意義的錯誤消息,像這樣。 MYSQL提供有史以來最無用的消息。 –

+0

其次...... –