isedeasy Posted March 2, 2010 Share Posted March 2, 2010 My sql query fails to work I am new to this BOOLEAN MODE search... SELECT DISTINCT MATCH(title, description) AGAINST ('search string' IN BOOLEAN MODE) d.id, d.title, d.description, m.image FROM deals d JOIN merchants m ON m.id = d.merchant WHERE d.status=1 AND MATCH(d.title, d.description) AGAINST ('search string' IN BOOLEAN MODE) ORDER BY d.added DESC LIMIT 0,24 here is the error I get... 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 '.id, d.title, d.description, m.image FROM deals d JOIN merchants m ON m.id = d.merchant WHERE d' at line 1 If I remove the "d." from "d.id" the query runs but it grabs the id from merchants table. Bad naming on my part but I hope I can solve it without having to change the column name. I am probably overlooking something really simple, cheers for any help Quote Link to comment https://forums.phpfreaks.com/topic/193934-boolean-distinct-match-search/ Share on other sites More sharing options...
isedeasy Posted March 2, 2010 Author Share Posted March 2, 2010 Sorry the code is SELECT DISTINCT MATCH(title, description) AGAINST ('search string' IN BOOLEAN MODE) AS d.id, d.title, d.description, m.image FROM deals d JOIN merchants m ON m.id = d.merchant WHERE d.status=1 AND MATCH(d.title, d.description) AGAINST ('search string' IN BOOLEAN MODE) ORDER BY d.added DESC LIMIT 0,24 the as got lost somehow Quote Link to comment https://forums.phpfreaks.com/topic/193934-boolean-distinct-match-search/#findComment-1020650 Share on other sites More sharing options...
isedeasy Posted March 3, 2010 Author Share Posted March 3, 2010 I worked out what i was doing wrong SELECT DISTINCT MATCH(title, description) AGAINST ('search string' IN BOOLEAN MODE) AS relevance, d.id, d.title, d.description, m.image FROM deals d JOIN merchants m ON m.id = d.merchant WHERE d.status=1 AND MATCH(d.title, d.description) AGAINST ('search string' IN BOOLEAN MODE) ORDER BY relevance DESC LIMIT 0,24 Quote Link to comment https://forums.phpfreaks.com/topic/193934-boolean-distinct-match-search/#findComment-1020732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.