X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DB173D1C50D for ; Fri, 15 Aug 2003 10:54:00 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 28331-06 for ; Fri, 15 Aug 2003 07:53:52 -0300 (ADT) Received: from web14802.mail.yahoo.com (web14802.mail.yahoo.com [216.136.224.218]) by svr1.postgresql.org (Postfix) with SMTP id 87DB9D1B539 for ; Fri, 15 Aug 2003 07:53:49 -0300 (ADT) Message-ID: <20030815105352.63670.qmail@web14802.mail.yahoo.com> Received: from [200.219.69.252] by web14802.mail.yahoo.com via HTTP; Fri, 15 Aug 2003 07:53:52 ART Date: Fri, 15 Aug 2003 07:53:52 -0300 (ART) From: =?iso-8859-1?q?=C2ngelo=20Marcos=20Rigo?= Subject: Re: Update script To: col@mportal.hu Cc: pgsql-php@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/61 X-Sequence-Number: 2238 Hi Col Thank´s for the postgre version note my problem was that i just forget the name=id atribute in the textfield Best regards --- CoL escreveu: > Hi, > > > Ângelo Marcos Rigo wrote, On 8/14/2003 3:46 PM: > > Hi > > > > I have a script to update some records in a > postgresql > > database. when i do modify what i have to modify > it > > give me the warning: > > > > Warning: pg_query() query failed: ERROR: pg_atoi: > > zero-length string in > > /var/www/html/adm/modificar_2.php on line 24 > > ERROR > > > > this is line 24: > > $result = pg_query($db, $query); > > > > this is modificar_2.php : > > > > > $id = $_POST['id']; > > $titulo = $_POST['titulo']; > > $texto = $_POST['texto']; > > > > include 'db.php'; > > $query = "UPDATE table SET titulo='$titulo', > > texto='$texto' WHERE id='$id'"; > print $query; You will get: > UPDATE table SET titulo='somthing',texto='text' > WHERE id='' > > And your pg version is >= 7.2, where you can not > insert '' string in > integer type. cast $id as integer, '".($id+0)."' or > intval or others. > > C. > > > ---------------------------(end of > broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster ===== Ângelo Marcos Rigo AMR Informática (51) 3348 0870 Rua Pe. Alois Kades 400/210 Porto Alegre /RS/Brasil http://amr.freezope.org angelo_rigo@yahoo.com.br _______________________________________________________________________ Conheça o novo Cadê? - Mais rápido, mais fácil e mais preciso. Toda a web, 42 milhões de páginas brasileiras e nova busca por imagens! http://www.cade.com.br