MySQL - How do I insert an additional where clause into this full-text search query
- by Steven
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";