Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1FC264760F5 for ; Tue, 10 Dec 2002 11:53:09 -0500 (EST) Received: from nplex.globo.com (email.globo.com [200.208.9.53]) by postgresql.org (Postfix) with ESMTP id 888C44760DB for ; Tue, 10 Dec 2002 11:53:08 -0500 (EST) Received: from [200.219.69.252] by nplex.globo.com with HTTP; Tue, 10 Dec 2002 14:52:45 -0200 Date: Tue, 10 Dec 2002 13:52:45 -0300 Message-ID: <3DCBFE22000E94C8@riosf06.globoi.com> In-Reply-To: From: angelo.rigo@globo.com Subject: Re: forms /selects To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/26 X-Sequence-Number: 1701 Hi I see my error was not using the "like" but now i fall in other problem: I have made an if else to display a message if have no name with the selected leter as initial it works but disply too: Warning: Unable to jump to row 0 on PostgreSQL result index 2 in /var/www/h= tml/inscricao/resultado_a1.php on line 80 how could i handle this? Thank?s in advance: here is my actual code: Pesquisa de nome por letra inicial
">

<"); } else $row=3D0; printf (""); printf (""); do { $myrow =3D pg_fetch_array ($result,$row); if($row % 2) { $bgcolor=3D"#FFFF99"; } else { $bgcolor=3D""; } printf ("",$myrow[nome]); $row++; } while ($row < $numrows); printf ("
Nome
%s
"); pg_close($db); ?> '>'-- Mensagem Original -- '>'To: pgsql-php@postgresql.org '>'Subject: Re: [PHP] forms /selects '>'From: jco@cornelius-olsen.dk '>'Date: Tue, 10 Dec 2002 15:03:33 +0100 '>' '>' '>'I see a couple of errors, one of which is the source of your problem. '>'You write: '>' "SELECT name FROM thetable WHERE (nome=3D$leter%) ORDER BY nome ASC"; '>'This would evaluate to '>' "SELECT name FROM thetable WHERE (nome=3DA%) 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=F8rn Cornelius Olsen ________________________________________ A busca mais veloz e precisa da internet. Acesse agora: http://www.zoom.com= .br.