Re: forms /selects

From: jco(at)cornelius-olsen(dot)dk
To: pgsql-php(at)postgresql(dot)org
Subject: Re: forms /selects
Date: 2002-12-10 14:03:33
Message-ID: OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

I see a couple of errors, one of which is the source of your problem.
You write:
"SELECT name FROM thetable WHERE (nome=$leter%) ORDER BY nome ASC";
This would evaluate to
"SELECT name FROM thetable WHERE (nome=A%) ORDER BY nome ASC";

What you need to write is:
"SELECT name FROM thetable WHERE (nome like '$leter%') ORDER BY nome ASC";

"like" is required to make regular expression match.
The quotes are always required when dealing with strings (and a few other
types).

You could have just debugged this by
echo $query;

Also: Letter contains two t's. :)

Regards
/Jørn Cornelius Olsen

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Vince Vielhaber 2002-12-10 14:16:54 Re: Large file upload
Previous Message jco 2002-12-10 13:56:40 Re: Large file upload