RE: [PHP] LIKE condition in query
| From: | Jay Blanchard | Date: | Tue, 05 Nov 2002 18:51:11 +0000 |
| Subject: | RE: [PHP] LIKE condition in query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122837@lists.php.net to get a copy of this message | ||
[snip]
$Query="
SELECT FieldName1, FieldName2
FROM TableName
WHERE FieldName1 LIKE '$CriterionRecord'
";
[/SNIP]
The LIKE criteria needs to be surrounded by wildcards...
WHERE FieldName1 LIKE '%$CriterionRecord%'
HTH!
Jay