#38598 [Fbk->Opn]: Query parameters are bound using wrong data type

From: Date: Mon, 28 Aug 2006 09:47:20 +0000
Subject: #38598 [Fbk->Opn]: Query parameters are bound using wrong data type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-101423@lists.php.net to get a copy of this message
ID: 38598 User updated by: michael dot walter at gmail dot com Reported By: michael dot walter at gmail dot com -Status: Feedback +Status: Open Bug Type: PDO related Operating System: Windows XP PHP Version: 5.2.0RC2 New Comment: ODBC Previous Comments: ------------------------------------------------------------------------ [2006-08-27 22:23:25] iliaa@php.net What driver are you using? ------------------------------------------------------------------------ [2006-08-25 20:24:11] michael dot walter at gmail dot com Description: ------------ Given a table post_stats with an 'id int IDENTITY(1,1) PRIMARY KEY' column, the following query fails (see below). Is that expected, and bindParam() to be used? Reproduce code: --------------- $pdo->prepare("SELECT * FROM (SELECT TOP 1 * FROM (SELECT TOP 1 * FROM post_stats WHERE (id = ?) ORDER BY id ASC) AS temp1 ORDER BY id DESC")->execute(array(1)); Expected result: ---------------- Nothing. Actual result: -------------- Exception: ...[SQL Server]Explicit conversion from data type text to int is not allowed... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38598&edit=1

« previous php.bugs (#101423) next »