時,這是我的查詢:「語法錯誤」 使用Zend_Db的查詢MySQL數據庫
$query = $db
->select()
->from(array('ns' => 'news_subscriber'),
array('ns.id', 'ns.subscriber_email')
)
->where('ns.id NOT IN (?)',
$db
->select()
->from(array('nss' => 'news_subscribers_has_news_letter_content'),
array('nss.news_subscribers_id')
)
->where('nss.news_letter_content_id =' , $id)
);
$subscribers = $db->fetchAll($query);
我收到此錯誤:
Syntax error or access violation 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 '))))' at line 1`
我覺得這個問題是在 「IN」。
任何想法?
我已經在這篇文章中爲您解決了格式問題,但請在將來發布問題時查看http://stackoverflow.com/editing-help。 – Treffynnon 2011-04-28 08:38:40