嗨,我試圖顯示出現在:table_templates_boxes但不存在於:table_templates_boxes_to_pages中的數據,但出現錯誤。 Plesrs幫我出您的SQL語法在''附近出現錯誤':table_templates_boxes_to_pages
這裏是我的代碼
SELECT
tb.id,
tb.code
FROM
mxp_templates_boxes tb,
mxp_templates_boxes_to_pages tbtp
WHERE templates_id = 3
AND tb.id NOT IN
(SELECT
templates_boxes_id
FROM
:table_templates_boxes_to_pages)
ORDER BY tbtp.sort_order
表名不能以':'開頭。 – xdazz
請發佈確切的錯誤你得到。我想這可能是這樣的:'從 :table_'刪除':' – Melon
這些應該是表名,或Ruby:符號,或PHP PDO參數? –