roxiroxi Posted December 13, 2006 Share Posted December 13, 2006 Hi people, anyone has any example of how i can add these operators into my search???? I cant get anyI mean, when a user enter the film batman and returns, it searches films with batman and returns wordsThanks Link to comment https://forums.phpfreaks.com/topic/30514-and-not-or-in-searches/ Share on other sites More sharing options...
micky1955 Posted December 14, 2006 Share Posted December 14, 2006 you can use AND & OR as follows:$search1 = "Batman";$search2 = "Returns";SELECT * FROM DBASE WHERE Title LIKE '%$search1%' [color=red]OR[/color] Title LIKE '%$search2%' ;SELECT * FROM DBASE WHERE Title LIKE '%$search1%' [color=red]AND[/color] Title LIKE '%$search2%' ;using [color=red]LIKE[/color] with the [color=red]%%[/color] option means that for a result the search text must be found somewhere in the field. Link to comment https://forums.phpfreaks.com/topic/30514-and-not-or-in-searches/#findComment-140788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.