#46591 [Opn->Bgs]: replace into syntax cannot null for PK in mysql
| From: | lbarnaud@php.net | Date: | Mon, 17 Nov 2008 10:58:52 +0000 |
| Subject: | #46591 [Opn->Bgs]: replace into syntax cannot null for PK in mysql | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131023@lists.php.net to get a copy of this message | ||
ID: 46591
Updated by: lbarnaud@php.net
Reported By: akbar6393222 at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: *
PHP Version: 5.2.6
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. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
This error message from MySQL is displayed when you are using some
non-default sql_modes. See
http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
Your PHP script probably sets a mode that triggers this error.
Previous Comments:
------------------------------------------------------------------------
[2008-11-17 06:24:44] akbar6393222 at yahoo dot com
Description:
------------
I execute this directly on mysql 5.1.25-rc-community on command line,
it's work
REPLACE INTO qna_content
(id,service_id,qna_id,service,sub_service,content,sub_content,publish_date,status,ctn_seq,first_ctn,last_update,update_by)
VALUES ( '','1','1','alam',
'','tes','','0000-00-00','1', '1',
'0',
NOW(), 'akbar' )
But in php 5.2.6, trigger error :
Incorrect integer value: ' ' for column 'id' at row 1
error number 1366
Reproduce code:
---------------
REPLACE INTO qna_content
(id,service_id,qna_id,service,sub_service,content,sub_content,publish_date,status,ctn_seq,first_ctn,last_update,update_by)
VALUES ( '','1','1','alam',
'','tes','','0000-00-00','1', '1',
'0',
NOW(), 'akbar' )
Expected result:
----------------
I need to be work for that code so I don't need to check another filter
validation
Actual result:
--------------
Incorrect integer value: ' ' for column 'id' at row 1
error number 1366
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46591&edit=1