php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38598 Query parameters are bound using wrong data type
Submitted: 2006-08-25 20:24 UTC Modified: 2009-05-03 01:00 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: michael dot walter at gmail dot com Assigned: Wez (profile)
Status: No Feedback Package: PDO related
PHP Version: 5.2.0RC2 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-08-25 20:24 UTC] 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...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-27 22:23 UTC] iliaa@php.net
What driver are you using?
 [2006-08-28 09:47 UTC] michael dot walter at gmail dot com
ODBC
 [2009-04-25 14:39 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 19:01:30 2024 UTC