I am not up on my MS Access database sql but i would check to see if ms
access supports the like condition in the where clause...


On Tue, 2002-11-05 at 18:49, Don Hicks wrote:
> I'm writing an SQL query in a php 4.0 script.  The query pulls data from an
> MS Access '97 database through an ODBC connection.
> 
> I'm having difficulties creating a condition using "LIKE".
> 
> If I write the following expression, the query works:
> 
> $Query="
> SELECT FieldName1, FieldName2
> FROM TableName
> WHERE FieldName1 = '$CriterionRecord'
> ";
> 
> But, if I change the Where statement from "=" to "LIKE", the query no longer
> works, and I can't figure out why. (Could it be punctuation?) Here's an
> example:
> 
> $Query="
> SELECT FieldName1, FieldName2
> FROM TableName
> WHERE FieldName1 LIKE '$CriterionRecord'
> ";
> 
> The criterion record is actually chosen in another form and passed through
> to this script.  The criterion record may be a complete record, or it may be
> a partial record with a wildcard, but the "LIKE" script is not working in
> either case.
> 
> Does anyone have any experience with this they could share with me?
> 
> Sincerely,
> Don Hicks
> Portland, OR
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to