Re[2]: [PHP-DB] Case insensitive searches with Postgres

From: Date: Thu, 21 Sep 2000 04:24:00 +0000
Subject: Re[2]: [PHP-DB] Case insensitive searches with Postgres
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-3038@lists.php.net to get a copy of this message
Hello kerry, Thursday, September 21, 2000, 5:09:04 AM, you wrote: knsc> I tried your suggestion and I get the following error: knsc> Warning: PostgresSQL query failed: ERROR: regcomp failed with error empty knsc> (sub)expression in knsc> /home/kerry/homepage/secondchance.php/list.php on line 45 knsc> An error occurred. knsc> Would escaping like \"~*\" solve this issue or am I missing something? Escaping the operator definitely wouldn't help, but checking $author and $title for empty strings before doing the query would... That's what Postgres is trying to tell you. ;-> knsc> On Thu, Sep 21, 2000 at 10:49:35AM +1100 or thereabouts, john slee wrote: >> ~* is a regexp compare, which is very different from 'like'. >> >> you want something like >> >> pg_exec($conn, "SELECT DISTINCT author,title,price FROM books >> WHERE author ~* '$author' OR title ~* '$title'"); >> >> if you put % in, the regexp engine will look for it in the text, which i >> don't think is what you want :) -- Yours, Alexey V. Borzov

« previous php.db (#3038) next »