Re: Inserting NULL into Integer column

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: Jeremy Smith <jer(at)highboard(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Inserting NULL into Integer column
Date: 2004-02-18 20:58:31
Message-ID: Pine.LNX.4.33.0402181357470.3399-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

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? :-)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2004-02-18 21:29:56 Re: Inserting NULL into Integer column
Previous Message Rod Taylor 2004-02-18 20:53:55 Re: Inserting NULL into Integer column

Browse pgsql-sql by date

  From Date Subject
Next Message FastEddie 2004-02-18 21:15:07 SQL / Join Help
Previous Message Rod Taylor 2004-02-18 20:53:55 Re: Inserting NULL into Integer column