#20506 [Opn]: insert null value into float/double mysql gives 0

From: Date: Tue, 19 Nov 2002 22:14:03 +0000
Subject: #20506 [Opn]: insert null value into float/double mysql gives 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-25298@lists.php.net to get a copy of this message
ID: 20506 User updated by: haagsepatrick@hotmail.com Reported By: haagsepatrick@hotmail.com Status: Open Bug Type: MySQL related Operating System: Windows98 PHP Version: 4.2.1 New Comment: Using $specialprice="Null"; or $specialprice=Null; gives the same result Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#25298) next »