|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-02-11 09:51 UTC] ipernet at gmail dot com
[2013-03-12 15:23 UTC] uw@php.net
[2013-06-16 03:07 UTC] kenji dot uui at gmail dot com
[2014-01-01 12:34 UTC] felipe@php.net
-Package: PDO related
+Package: PDO MySQL
[2014-03-20 16:09 UTC] uw@php.net
-Package: PDO MySQL
+Package: PDO Core
[2014-03-20 16:09 UTC] uw@php.net
[2016-10-10 22:28 UTC] adambaratz@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: adambaratz
[2016-10-10 22:28 UTC] adambaratz@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
Description: ------------ PHP: 5.4.11 PDO Client API version: mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $ MySQL: 5.5.18-log Using a PDO prepared statement to insert a new row, the query fails if a float value is passed for a token and this token use PDO::PARAM_INT as data type. Test script: --------------- CREATE TABLE IF NOT EXISTS `test` ( `kms` int(10) unsigned NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; ------------------------------------------- $query = $dbh->prepare('INSERT INTO test(kms) VALUES(:kms)'); $query->bindValue(':kms', 1.25, PDO::PARAM_INT); $query->execute(); var_dump($query->errorInfo()); Expected result: ---------------- - "1" should be inserted in the table - Query should execute properly and do not lead to a SQL parsing error. Actual result: -------------- array(3) { [0] => string(5) "21S01" [1] => int(1136) [2] => string(47) "Column count doesn't match value count at row 1" }