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 94611D1E136 for ; Wed, 18 Feb 2004 21:07:19 +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 91939-03 for ; Wed, 18 Feb 2004 17:07:18 -0400 (AST) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 9913ED1D1A4 for ; Wed, 18 Feb 2004 17:07:15 -0400 (AST) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.10/8.12.10) with ESMTP id i1IL5EVo008592; Wed, 18 Feb 2004 14:05:14 -0700 (MST) Date: Wed, 18 Feb 2004 13:58:31 -0700 (MST) From: "scott.marlowe" To: Rod Taylor Cc: Jeremy Smith , Subject: Re: Inserting NULL into Integer column In-Reply-To: <1077137634.18564.418.camel@jester> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/263 X-Sequence-Number: 16953 On Wed, 18 Feb 2004, Rod Taylor wrote: > > 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. Note that the ' marks aren't part of the string, they are the delimiter of the string, and I always run every server with magic_quotes_gpc on. anything else? :-)