RE: [PHP-DEV] PHP 4.0 Bug #7592: LIKE operator fails

From: Date: Thu, 02 Nov 2000 21:01:35 +0000
Subject: RE: [PHP-DEV] PHP 4.0 Bug #7592: LIKE operator fails
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-36840@lists.php.net to get a copy of this message
For a simple reason: Access makes use of different characters for pattern matching than ANSI SQL does. Try replacing * with % and see what the result is. If you are also using ?, you should replace it with _ Regards Daniel ----- Original Message ----- From: <frederic.choquet@caramail.com> To: <php-dev@lists.php.net> Sent: Thursday, November 02, 2000 4:09 PM Subject: [PHP-DEV] PHP 4.0 Bug #7592: LIKE operator fails > From: frederic.choquet@caramail.com > Operating system: WinNT 4.0 WS > PHP version: 4.0.3pl1 > PHP Bug Type: ODBC related > Bug description: LIKE operator fails > > It seems impossible to use the SQL "LIKE" operator with ODBC/ACCESS 97. > > ie: > $sqlstring = "SELECT Name FROM people WHERE Name LIKE \"A*\""; > $rst=odbc_exec($Conn, $sqlstring); > > ... may return the following err msg: > > Impossible d'utiliser cette expression avec le prédicat LIKE. dans l'expression 'Name alike A*' > > (sorry, it's in french, in english it may look like: Unable to use this expression with operator LIKE in expression 'Name alike A*') > > What does this "alike" means? > > If i echo $sqlstring, cut it and paste it directly to a query in Access, i got no err msg, so it is not a syntax error. > > > -- > Edit Bug report at: http://bugs.php.net/?id=7592&edit=1 > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#36840) next »