#20506 [Opn->Bgs]: insert null value into float/double mysql gives 0
| From: | derick@php.net | Date: | Wed, 20 Nov 2002 10:08:39 +0000 |
| Subject: | #20506 [Opn->Bgs]: insert null value into float/double mysql gives 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-25323@lists.php.net to get a copy of this message | ||
ID: 20506
Updated by: derick@php.net
Reported By: haagsepatrick@hotmail.com
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: Windows98
PHP Version: 4.2.1
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2002-11-19 16:14:03] haagsepatrick@hotmail.com
Using $specialprice="Null"; or $specialprice=Null; gives the same
result
------------------------------------------------------------------------
[2002-11-19 15:57:59] haagsepatrick@hotmail.com
In short:
$specialprice="Null";
$query = "UPDATE mytable SET mytable.specialprice =
'".$specialprice."'
WHERE ......";
submitted a "0"(zero) into mysql.
and:
$specialprice="mytable.specialprice =Null";
$query = "UPDATE mytable SET '".$specialprice."'
WHERE ......";
submitted Null, like it should.
I couldnt account why the first version would submit "0"
the mysql field has the following properties:
type:float,
length=11,
decimals=2,
allow null:true,
unsigned: false,
zerofill: false,
default value:empty
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20506&edit=1