willl69 wrote:
Hi Guys
I have to do a very intensive and accurate database search using PHP nad
MySQL. I was wondering if anyone knew any good resources or where i could
get examples of good queries for a fulltext indexed database search.
Cheers
Willl
Here's one of my favorites:
SELECT
Artist.Name AS 'Artist',
Artist.AddThe AS 'ArtistAddThe',
Artist.RecId AS 'ArtistRecId',
Disc.Title AS 'Disc',
Disc.AddThe AS 'DiscAddThe',
Disc.RecId AS 'DiscRecId',
Track.Title AS 'Title',
Track.AddThe AS 'TrackAddThe',
Track.RecId AS 'TrackRecId',
Track.Number AS 'Track'
FROM Artist,
INNER JOIN Disc ON Disc.Artist=Artist.RecId
INNER JOIN Track ON Track.Disc=Disc.RecId
WHERE
Artist.Name LIKE '$search_artist'
AND
Disc.Title LIKE '$search_disc'
AND
Track.Title LIKE '$search_track'
ORDER BY
Artist,
Disc.Year,
Disc,
Track