#38598 [Opn->Fbk]: Query parameters are bound using wrong data type
| From: | iliaa@php.net | Date: | Sun, 27 Aug 2006 22:23:25 +0000 |
| Subject: | #38598 [Opn->Fbk]: Query parameters are bound using wrong data type | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101396@lists.php.net to get a copy of this message | ||
ID: 38598
Updated by: iliaa@php.net
Reported By: michael dot walter at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Windows XP
PHP Version: 5.2.0RC2
New Comment:
What driver are you using?
Previous Comments:
------------------------------------------------------------------------
[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