Answer the question
In order to leave comments, you need to log in
Is it possible to complete the SQL query?
$words = explode(" ", $search);
for ($i = 0; $i < count($words); $i++) {
$if_clause .= "indexing_word.word='" . $words[$i] . "'";
if ($i != count($words) - 1) {
$if_clause .= " or ";
}
}
$sql = "SELECT indexing_link.id, indexing_link.url, indexing_link.title, indexing_link.short
FROM indexing_link, indexing_link_word, indexing_word
WHERE (" . $if_clause . ")
AND indexing_link_word.word_id=indexing_word.id
AND indexing_link.id=indexing_link_word.link_id";
Answer the question
In order to leave comments, you need to log in
Something like this:
SELECT
indexing_link.id,
indexing_link.url,
indexing_link.title,
indexing_link.short
FROM indexing_link, indexing_link_word, indexing_word
WHERE
(:searchWords)
AND indexing_word.word not in (:stopWords)
AND indexing_link_word.word_id=indexing_word.id
AND indexing_link.id=indexing_link_word.link_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question