我的搜索查詢出現問題。我在尋找電子郵件。Mysql使用布爾值給予錯誤值的電子郵件搜索
我有這樣我的搜索查詢:
$query = sprintf("SELECT mailer_subscribers.id, mailer_subscribers.email, mailer_subscribers.status,mailer_segmentlinker.segment_id, mailer_segmenten.segmentnaam FROM mailer_subscribers
JOIN mailer_segmentlinker ON mailer_subscribers.id=mailer_segmentlinker.subscriber_id
JOIN mailer_segmenten ON mailer_segmentlinker.segment_id=mailer_segmenten.id
WHERE MATCH (email) AGAINST ('%s*' IN BOOLEAN MODE)", $key);
但是,當我打字例如「john.smith
」的關鍵字,返回我有相同的名字或姓氏的所有值
[email protected]
[email protected]
[email protected]
[email protected]
我需要它會給我列出john.smith
。
編輯:
解決方案這讓我這個是: WHERE mailer_subscribers.email LIKE '%%%s%%'", $key);
試'WHERE電子郵件LIKE%和John.Smith%' – 2013-02-18 08:50:36