#39161 [Asn->Bgs]: parameter names not sent to prepared statement

From: Date: Sun, 03 Dec 2006 23:39:09 +0000
Subject: #39161 [Asn->Bgs]: parameter names not sent to prepared statement
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105832@lists.php.net to get a copy of this message
ID: 39161 Updated by: iliaa@php.net Reported By: aspen dot olmsted at alliance dot biz -Status: Assigned +Status: Bogus Bug Type: PDO related Operating System: windows xp sp 2 PHP Version: 5CVS-2006-10-15 (snap) Assigned To: wez New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php see previous comment. Previous Comments: ------------------------------------------------------------------------ [2006-10-15 18:08:47] wez@php.net That's correct. This is currently the expected behavior. ------------------------------------------------------------------------ [2006-10-15 15:35:42] aspen dot olmsted at alliance dot biz 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 this bug report at http://bugs.php.net/?id=39161&edit=1

« previous php.bugs (#105832) next »