mameha1977
10-19-2006, 03:51 AM
Im having trouble with the LIKE operator.
I have some 'country' strings like this:
1) "AR AU"
2) "AR"
3) "AU"
I want to get strings that contain AR, ie 1 and 2. But when I do the following query, it returns 1, 2 and 3, because the A in AU seems to be enough to satisfy the LIKE:
$country = AR;
SELECT * FROM table WHERE country LIKE "%'.$country.'%"
How do I make it only return strings that contain exactly AR?
I have some 'country' strings like this:
1) "AR AU"
2) "AR"
3) "AU"
I want to get strings that contain AR, ie 1 and 2. But when I do the following query, it returns 1, 2 and 3, because the A in AU seems to be enough to satisfy the LIKE:
$country = AR;
SELECT * FROM table WHERE country LIKE "%'.$country.'%"
How do I make it only return strings that contain exactly AR?