pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jco@cornelius-olsen.dk
To: pgsql-php@postgresql.org
Subject: Re: forms /selects
Date: Tue, 10 Dec 2002 15:03:33 +0100
Message-ID: <OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk> (raw)

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

view thread (3+ messages)  latest in thread

Message-ID: <OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk>
Permalink:  ../OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk/
Also on:    postgresql.org/message-id/OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: jco@cornelius-olsen.dk
  Subject: Re: forms /selects
  In-Reply-To: <OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk>
  References: <OFDE05BAC9.342E6EA3-ONC1256C8B.004CC51B@dk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox