From: aspen dot olmsted at alliance dot biz Operating system: windows xp sp 2 PHP version: 5CVS-2006-10-15 (snap) PHP Bug Type: PDO related Bug description: parameter names not sent to prepared statement
Description: ------------ If I call a SQL 2000 stored procedure through pdo odbc in a prepared statement it will not set the proper field order if the order does not match the parameter order in the SP. Reproduce code: --------------- 2000 SQL SP (can be empty): create procedure pdo_test2 @Param1 int, @Param2 varchar(100) as PHP Code: $a["param1"] = '26050'; $a["param2"] = 'test'; $sql = "exec pdo_test2 @param2 = :param2,@param1 = :param1"; $stmt = $dbh->prepare($sql); $x = $stmt->execute($a); Expected result: ---------------- The column order should not matter if the names are passed Actual result: -------------- If I trace in sql I see the following: exec sp_prepare @P1 output, N'@Param1 int,@Param2 varchar(100)', N'exec pdo_test2 @param2 = @Param1,@param1 = @Param2', 1 -- Edit bug report at http://bugs.php.net/?id=39161&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39161&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39161&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39161&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39161&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39161&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39161&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39161&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39161&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39161&r=support Expected behavior: http://bugs.php.net/fix.php?id=39161&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39161&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39161&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39161&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39161&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39161&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39161&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39161&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39161&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39161&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39161&r=mysqlcfg