Re: forms /selects - Mailing list pgsql-php

From jco@cornelius-olsen.dk
Subject Re: forms /selects
Date
Msg-id OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk
Whole thread Raw
In response to forms /selects  (angelo.rigo@globo.com)
Responses Re: forms /selects
List 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

pgsql-php by date:

Previous
From: jco@cornelius-olsen.dk
Date:
Subject: Re: Large file upload
Next
From: Vince Vielhaber
Date:
Subject: Re: Large file upload