我基本上試圖MySQL查詢 我的新的當前查詢作爲跟隨MySQL的「不」查詢引發錯誤
SELECT `o`.`id`, `o`.`name`, `o`.`url`, `o`.`type`, `o`.`desc` FROM `offers` as `o`
WHERE `o`.country_iso = '$country_iso' AND `o`.`id` not in
(select distinct(offer_id) from conversions where ip = '$_SERVER[REMOTE_ADDR]'
and converted != '0') AND `o`.`id` not in
(select `offer_id` from `aff_disabled_offers` where `offer_id` = 'o.id'
and `user_id` = '1') ORDER by rand() LIMIT $limit
查詢工作期間不要使用函數兩次,但由於某種原因,它是完全忽略這個
AND `o`.`id` not in
(select `offer_id` from `aff_disabled_offers` where `offer_id` = 'o.id')
希望你嘗試添加'而不是...' – agim
什麼是完整的錯誤消息? –
閱讀關於引用:http://stackoverflow.com/questions/11321491/mysql-when-to-use-single-quotes-double-quotes-and-backticks/11321508#11321508 –