|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-28 09:56 UTC] wez@php.net
[2005-10-28 10:20 UTC] bmansion at mamasam dot com
[2005-10-28 23:01 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 19:00:01 2025 UTC |
Description: ------------ Actually, the version is PHP Version 5.1.0RC2-dev compiled on Oct 1 2005 When given an array containing an integer, pdo->execute() will convert the type to a string. Reproduce code: --------------- <?php /*CREATE TABLE book ( id int(11) NOT NULL, PRIMARY KEY (id) ); INSERT INTO book VALUES (1);*/ $pdo = new PDO('mysql:dbname=bookstore;host=localhost', 'bookstore', 'password'); $values = array(1); var_dump($values); $stmt = $pdo->prepare('SELECT * FROM book WHERE id = ?'); $stmt->execute($values); var_dump($values); ?> Expected result: ---------------- array(1) { [0]=> int(1) } array(1) { [0]=> int(1) } Actual result: -------------- array(1) { [0]=> int(1) } array(1) { [0]=> string(1) "1" }