searching an SQL table using keywords

Associate
Joined
26 Jul 2005
Posts
352
evenin all, hope someone can help me here,

im trying to search a field 'keywords' in a table called 'photos'

now the keywords field will have things like; "Landscape, water, beach, lighthouse" - but i just cant find an SQL query that will work when i search for the term 'landscape' and bring all results with the keyword landscape.

any pointers? cheers :D
 
thank you muchly that works for what i need :D:D:D

how about searching more than one field? it doesnt seem to work on my description field which is not neat and ordered with comma's but a description about the photo?

SELECT *
FROM `photos`
WHERE `keywords` LIKE '$searchvalue'
AND `description` LIKE '$searchvalue'
ORDER BY `photos`.`ID` DESC
LIMIT 0 , 4
 
Back
Top Bottom