On Wed, 18 Feb 2004, Rod Taylor wrote:
> > 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? :-)
>
> Good point. I looked at the single quotes of the second line and somehow
>
> 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? :-)
Good point. I looked at the single quotes of the second line and somehow
the DEFAULT got quoted as well ;)
-
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
> 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 som
On Wed, 18 Feb 2004, Jeremy Smith wrote:
>
>
> I've run into this kind of thing before. IT helps if you have an array of
> all your fields like:
>
> $fields = array("field1","field3","last_name");
>
> and then you can foreach across the input:
>
> foreach($fields as $f){
> if (!$_POST[$f])
I've run into this kind of thing before. IT helps if you have an array of
all your fields like:
$fields = array("field1","field3","last_name");
and then you can foreach across the input:
foreach($fields as $f){
if (!$_POST[$f]){
$_POST[$f]='DEFAULT';
} else {
$_POST[$f] = "'".$_PO
better checking, so it's a bit of
a trade off.
> Anyway, the help on this list is much appreciated..
>
> Jeremy
>
> -----Original Message-
> From: scott.marlowe [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 18, 2004 2:44 PM
> To: Jeremy Smith
> Cc:
--
From: scott.marlowe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 18, 2004 2:44 PM
To: Jeremy Smith
Cc: [EMAIL PROTECTED]
Subject: Re: [SQL] Inserting NULL into Integer column
On Wed, 18 Feb 2004, Jeremy Smith wrote:
> Hi,
>
> in mysql I was able to make an insert such as:
>
&g
On Wed, 18 Feb 2004, Jeremy Smith wrote:
> Hi,
>
> in mysql I was able to make an insert such as:
>
> INSERT INTO TABLE (integervariable) VALUES ('')
>
> and have it either insert that variable, or insert the default if it had
> been assigned. In postgresql it gives and error every time that t