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 BF1A0D1B524 for ; Thu, 14 Aug 2003 23:49:32 +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 32115-06 for ; Thu, 14 Aug 2003 20:49:25 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 33DFBD1B56B for ; Thu, 14 Aug 2003 20:49:22 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7ENnLek061204 for ; Thu, 14 Aug 2003 23:49:21 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7ENKKWg053874 for pgsql-php@postgresql.org; Thu, 14 Aug 2003 23:20:20 GMT From: CoL X-Newsgroups: comp.databases.postgresql.interfaces.php Subject: Re: Update script Date: Fri, 15 Aug 2003 01:22:32 +0200 Organization: Hub.Org Networking Services Lines: 36 Message-ID: References: <20030814134646.77797.qmail@web14805.mail.yahoo.com> Reply-To: col@mportal.hu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030718 X-Accept-Language: hu, en-us, en In-Reply-To: <20030814134646.77797.qmail@web14805.mail.yahoo.com> To: pgsql-php@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/60 X-Sequence-Number: 2237 Hi, =C2ngelo Marcos Rigo wrote, On 8/14/2003 3:46 PM: > Hi=20 >=20 > 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:=20 >=20 > Warning: pg_query() query failed: ERROR: pg_atoi: > zero-length string in > /var/www/html/adm/modificar_2.php on line 24 > ERROR >=20 > this is line 24: > $result =3D pg_query($db, $query); >=20 > this is modificar_2.php : >=20 > $id =3D $_POST['id']; > $titulo =3D $_POST['titulo']; > $texto =3D $_POST['texto']; >=20 > include 'db.php';=20 > $query =3D "UPDATE table SET titulo=3D'$titulo', > texto=3D'$texto' WHERE id=3D'$id'"; print $query; You will get: UPDATE table SET titulo=3D'somthing',texto=3D'text' WHERE id=3D'' And your pg version is >=3D 7.2, where you can not insert '' string in=20 integer type. cast $id as integer, '".($id+0)."' or intval or others. C.