2013-10-09 82 views
0

執行以下查詢後出現SQL錯誤。Joomla SQL錯誤1064

UPDATE #_menu 
SET component_id = 
    (SELECT extension_id FROM #_extensions WHERE name = "com_joomlaupdate") 
WHERE title = "com_joomlaupdate" 

#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 'SET component_id = (SELECT extension_id FROM #_extensions WHERE name = "com_jo' at line 2 

我想在這裏跟隨Joomla示例。

Joomla SQL

回答

1

你錯過了你的表名下劃線:

#_menu >>#__menu

,所以你最終的代碼應該是:

UPDATE #__menu 
SET component_id = 
    (SELECT extension_id FROM #__extensions WHERE name = 'com_joomlaupdate') 
WHERE title = 'com_joomlaupdate' 

,或者你從PhpMyAdmin運行代碼,然後使用以下代碼:

UPDATE jos_menu 
    SET component_id = 
     (SELECT extension_id FROM jos_extensions WHERE name = 'com_joomlaupdate') 
    WHERE title = 'com_joomlaupdate' 

不要忘記改變jos,無論你是數據庫表的前綴是

+0

不,那是不是。這是一個可憐的Joomla在他們的網站上沒有正確的信息! – Spitfire

+0

ahh你在PHPmyAdmin中運行這個查詢嗎? – Lodder

+0

是的,我是。我只是複製上面的代碼並按下去。 – Spitfire