MySQL - How do I insert an additional where clause into this full-text search query

Posted by Steven on Stack Overflow See other posts from Stack Overflow or by Steven
Published on 2010-06-07T19:46:59Z Indexed on 2010/06/07 19:52 UTC
Read the original article Hit count: 230

Filed under:
|

I want to add a WHERE clause to a full text search query (to limit to past 24 hours), but wherever I insert it I get Low Level Error. Is it possible to add the clause and if so, how?

$query = "SELECT * WHERE story_time > time()-86400 AND MATCH (story_title) AGAINST ('".validate_input($_GET['q'])."' IN BOOLEAN MODE) AS Relevance FROM ".$config['db']['pre']."stories WHERE MATCH (story_title) AGAINST ('+".validate_input($_GET['q'])."' IN BOOLEAN MODE) HAVING Relevance > 0.2 ORDER BY Relevance DESC, story_time DESC LIMIT ".validate_input(($_GET['page']-1)*10).",10";

© Stack Overflow or respective owner

Related posts about mysql

Related posts about full-text-search