php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39161 parameter names not sent to prepared statement
Submitted: 2006-10-15 15:35 UTC Modified: 2006-12-03 23:39 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: aspen dot olmsted at alliance dot biz Assigned: wez (profile)
Status: Not a bug Package: PDO related
PHP Version: 5CVS-2006-10-15 (snap) OS: windows xp sp 2
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: aspen dot olmsted at alliance dot biz
New email:
PHP Version: OS:

 

 [2006-10-15 15:35 UTC] 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

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-15 18:08 UTC] wez@php.net
That's correct.  This is currently the expected behavior.
 [2006-12-03 23:39 UTC] iliaa@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Sep 09 08:01:28 2024 UTC