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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: michael dot walter at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 17:01:35 2025 UTC