|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesodbc.patch (last revision 2013-01-15 17:03 UTC by kraven at kraven dot org)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-05-15 18:59 UTC] burnhamrobertp at gmail dot com
[2012-10-18 17:05 UTC] kraven at kraven dot org
[2013-01-30 00:43 UTC] paul dot posts at gmail dot com
[2013-04-04 20:36 UTC] me at andrewkehrig dot com
[2014-01-01 12:38 UTC] felipe@php.net
-Package: PDO related
+Package: PDO ODBC
[2014-03-17 13:08 UTC] donald dot sipe at gmail dot com
[2014-04-20 23:57 UTC] stas@php.net
-Status: Open
+Status: Feedback
[2014-04-20 23:57 UTC] stas@php.net
[2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
[2015-02-02 15:54 UTC] frozen at frozen-solid dot net
[2015-04-29 12:54 UTC] omar dot piani at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
Description: ------------ When trying to bind parameters to a prepared statement, bindValue() and bindParam() both return false with the error code HY004, [SQL Server Native Client 11.0]Invalid SQL data type (SQLBindParameter[0] at /build/buildd/php5- 5.3.10/ext/pdo_odbc/odbc_stmt.c:379) It does not matter whether you pass in PDO::PARAM_STR or PARAM_INT or no data type specification, the error is the same every time. Using parameters with odbc_connect() and odbc_prepare() work as expected, so the issue is directly related to PDO, not to ODBC or Microsoft's driver. Test script: --------------- $db = new PDO('odbc:sqltest', 'wwwuser', 'btsb'); $strSql = 'select top 10 * from oltmaster where titleno = :no'; $q = $db->prepare($strSql); var_dump($q->bindValue(':no', '029803')); var_dump($q->errorInfo()); Expected result: ---------------- boolean true array 0 => string '' (length=0) 1 => int 0 2 => string ' ((null)[0] at (null):0)' (length=24) 3 => string '' (length=0) Actual result: -------------- boolean false array 0 => string 'HY004' (length=5) 1 => int 0 2 => string '[Microsoft][SQL Server Native Client 11.0]Invalid SQL data type (SQLBindParameter[0] at /build/buildd/php5-5.3.10/ext/pdo_odbc/odbc_stmt.c:379)' (length=143) 3 => string 'HY004' (length=5)