|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: haagsepatrick at hotmail dot com
New email:
PHP Version: OS:


 [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 Feb 20 23:01:27 2024 UTC