2015-09-28 98 views
0

我需要在time.Here刪除從三個表中的記錄是我的查詢: -笨刪除查詢不能

$query =$this->db->query("DELETE ps_faq_categories FROM ps_faq_categories INNER JOIN ps_faqs ON('ps_faq_categories.faq_category_id = ps_faqs.faq_category_id') 
        INNER JOIN ps_faq_comments ON('ps_faqs.faq_id = ps_faq_comments.faq_id') WHERE 'ps_faq_categories.faq_category_id' = $category_id"); 

我收到錯誤,如在指定的上下文非布爾類型的表達式「INNER」附近預計會出現一種情況。

回答

0

從查詢

$query =$this->db->query("DELETE ps_faq_categories,ps_faqs,ps_faq_comments FROM ps_faq_categories INNER JOIN ps_faqs ON(ps_faq_categories.faq_category_id = ps_faqs.faq_category_id) 
        INNER JOIN ps_faq_comments ON(ps_faqs.faq_id = ps_faq_comments.faq_id) WHERE ps_faq_categories.faq_category_id = $category_id"); 
+0

我曾經嘗試這樣做刪除單引號,但還沒有解決我得到的錯誤,附近有語法錯誤'「 – Youv

+0

從ps_faq_categories刪除,但未從ps_faqs刪除和記錄ps_faq_comments.Is其我的查詢中出現任何問題 – Youv

+0

再次檢查 –