我是Ruby on Rails的newby,我有搜索文本框,然後每次輸入apotraphe(')例如測試'單詞.....我總是收到錯誤:Mysql2 ::錯誤:您的SQL語法中有錯誤
Mysql2::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 's word%' OR english_name LIKE '%testing's word%' OR chinese_name LIKE '%testin' at line 1: SELECT COUNT(DISTINCT `jos_store`.`id`) FROM `jos_store` LEFT OUTER JOIN (SELECT id as store_replenishment, store, MAX(stock_movement) AS stock_movement FROM jos_store_replenishment GROUP BY store) AS replenishment ON replenishment.store = jos_store.id LEFT OUTER JOIN jos_stock_movement ON jos_stock_movement.id = replenishment.stock_movement WHERE (store_id LIKE '%testing's word%' OR english_name LIKE '%testing's word%' OR chinese_name LIKE '%testing's word%')
你能幫我解決我的問題嗎?
你可以發佈代碼,你創建/生成SQL請求? – Baldrick 2012-07-13 08:46:18
您應該簡要解釋您的問題以獲得正確的解決方案。像包括您的代碼等 – 2012-07-13 09:05:22
我有這個錯誤,當我導航到rails管理員,並嘗試編輯我的users.do你有什麼想法? – 2017-09-05 10:32:29