|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20506 insert null value into float/double mysql gives 0
Submitted: 2002-11-19 15:57 UTC Modified: 2002-11-20 04:08 UTC
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: haagsepatrick at hotmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.2.1 OS: Windows98
Private report: No CVE-ID: None
 [2002-11-19 15:57 UTC] haagsepatrick at hotmail dot com
In short:

$query = "UPDATE mytable SET mytable.specialprice = '".$specialprice."'
WHERE ......";
submitted a "0"(zero) into mysql.

$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:
allow null:true,
unsigned: false,
zerofill: false,
default value:empty


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-19 16:14 UTC] haagsepatrick at hotmail dot com
Using $specialprice="Null"; or $specialprice=Null; gives the same result
 [2002-11-20 04:08 UTC]
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 as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 14:01:33 2024 UTC