] Inserting NULL values does not work
Your problem is that you've included the value of $park in
single-quotes.
Therefore, because it contains NULL, i.e., \0, this is translated to '0'
in
the INSERT statement. You must make your test prior to the INSERT
statement
and use the proper $park
Your problem is that you've included the value of $park in single-quotes.
Therefore, because it contains NULL, i.e., \0, this is translated to '0' in
the INSERT statement. You must make your test prior to the INSERT statement
and use the proper $park value.
Or, you can:
if ($park == 'false'){
Why not make it a function which also checks and replaces for characters SQL
fails on eg if ' replace with '' in strings etc, and does any sanity /
validation checks at the same time?
Ollie
Rick Emery [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
Your problem is that you've
It's not failing on the single-quotes. MYSQL can use single-quotes.
-Original Message-
From: Oliver Cronk [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 10:01 AM
To: Php-Db ML; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Inserting NULL values does not work
Why not make
Like this for example:
http://www.phpbuilder.com/snippet/download.php?type=snippetid=378
-Original Message-
From: Oliver Cronk [mailto:[EMAIL PROTECTED]]
Sent: 01 February 2002 16:01
To: Php-Db ML; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Inserting NULL values does not work
Why
: [PHP-DB] Inserting NULL values does not work
It's not failing on the single-quotes. MYSQL can use single-quotes.
-Original Message-
From: Oliver Cronk [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 10:01 AM
To: Php-Db ML; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Inserting NULL
PROTECTED]'; Php-Db ML
Subject: RE: [PHP-DB] Inserting NULL values does not work
It's not failing on the single-quotes. MYSQL can use single-quotes.
-Original Message-
From: Oliver Cronk [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 10:01 AM
To: Php-Db ML; [EMAIL PROTECTED
:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 10:41 AM
To: Rick Emery; [EMAIL PROTECTED]; Php-Db ML
Subject: RE: [PHP-DB] Inserting NULL values does not work
I know its not failing on YOUR example but if there is a single quote in
the
data eg someones name is O'leary then the SQL will fail