diff --git a/basictitlesearch.php b/basictitlesearch.php index 814c991..7490732 100644 --- a/basictitlesearch.php +++ b/basictitlesearch.php @@ -1,7 +1,7 @@ query("SELECT -books.id AS id, +DISTINCT books.id AS id, books.title AS title, SUBSTR(comments.text,0,120) AS excerpt FROM books INNER JOIN comments ON comments.book = books.id -WHERE books.title LIKE '%$titlesearch%' +INNER JOIN +books_tags_link ON books_tags_link.book = books.id +INNER JOIN +tags ON tags.id = books_tags_link.tag +WHERE books.title LIKE '%$keywordsearch%' +OR books.author_sort LIKE '%$keywordsearch%' +OR comments.text LIKE '%$keywordsearch%' +OR tags.name LIKE '%$keywordsearch%' ORDER BY books.title ASC"); ?> diff --git a/index.php b/index.php index b2c4cc9..bd759de 100644 --- a/index.php +++ b/index.php @@ -119,7 +119,7 @@ LIMIT 4');