Re: Case insesnitive searches with postgres
| From: | kerry at noc dot suntrix dot com | Date: | Thu, 21 Sep 2000 20:08:37 +0000 |
| Subject: | Re: Case insesnitive searches with postgres | ||
| References: | 1 2 3 4 5 6 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3035@lists.php.net to get a copy of this message | ||
I set up psql v6.5.3 and the errors went away. The version I started out
with was 7.0.2. Guess its time for a bug report. Once again, hanks for
all of your help.
Kerry
On Thu, Sep 21, 2000 at 10:04:05AM -0400 or thereabouts, kerry@noc.suntrix.com wrote:
> Ahhhh, now I have been enlightened. Thank you for all of your help.
>
> Cheers!
>
> Kerry
>
> On Thu, Sep 21, 2000 at 01:49:28PM +1100 or thereabouts, john slee wrote:
> > On Wed, Sep 20, 2000 at 09:09:04PM -0400, kerry@noc.suntrix.com wrote:
> > > I tried your suggestion and I get the following error:
> >
> > > Warning: PostgresSQL query failed: ERROR: regcomp failed with error empty
> > > (sub)expression in
> > > /home/kerry/homepage/secondchance.php/list.php on line 45
> > > An error occurred.
> >
> > > Would escaping like \"~*\" solve this issue or am I missing something?
> >
> > strange. possibly $author or $title is empty - check if it is, and if
> > so don't insert the revelvant sql. something like this, perhaps:
> >
> > $sql = "SELECT title,author FROM books WHERE true";
> > if ($title != "") $sql .= " AND title ~* '$title'";
> > if ($author != "") $sql .= " AND author ~* '$author'";
> > $result = pg_exec($conn,$sql);
> >
> > (the 'WHERE true' is just to make generating the sql less painful, and
> > has no effect on the result)
> >
> > if this is indeed the problem, i'd report it as a bug to the postgresql
> > developers, it looks like an annoying thing to have to cope with. i
> > don't believe i've ever seen that error with psql 6.5.x though, what
> > version are you using?
> >
> > j.
> >
> > --
> > .----------+---------------------------------.
> > |John Slee `-------. <indigoid@chirp.com.au>|
> > |Chirp Web Design |
> > http://www.chirp.com.au|
> > |Phone 02 62301871 `--------. 02 62301515 Fax|
> > `---------------------------+----------------'
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>