X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C344BD1E13C for ; Wed, 18 Feb 2004 20:53:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 83638-04 for ; Wed, 18 Feb 2004 16:53:29 -0400 (AST) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 618F3D1E145 for ; Wed, 18 Feb 2004 16:53:27 -0400 (AST) Received: from [134.22.69.114] (dyn-69-114.tor.dsl.tht.net [134.22.69.114]) by tht.net (Postfix) with ESMTP id B1FDD76A82; Wed, 18 Feb 2004 15:53:32 -0500 (EST) Subject: Re: Inserting NULL into Integer column From: Rod Taylor To: Scott Marlowe Cc: Jeremy Smith , pgsql-sql@postgresql.org In-Reply-To: References: Content-Type: text/plain Message-Id: <1077137634.18564.418.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 18 Feb 2004 15:53:55 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/262 X-Sequence-Number: 16952 > and then you can foreach across the input: > > foreach($fields as $f){ > if (!$_POST[$f]){ > $_POST[$f]='DEFAULT'; > } else { > $_POST[$f] = "'".$_POST[$f]."'"; > } > } Default in quotes isn't going to work, and please tell me you escape those things with pg_escape_string() at some point.