php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16649 Wrong object type returned
Submitted: 2002-04-17 00:46 UTC Modified: 2002-04-27 06:00 UTC
From: anoop_alex at hotmail dot com Assigned:
Status: Not a bug Package: COM related
PHP Version: 4.1.2 OS: WIN2K
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: anoop_alex at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-04-17 00:46 UTC] anoop_alex at hotmail dot com
I have the following code which tries to execute a stored procedure using ADODB created using COM. The ad Constants and strConnect have been defined in an include file.

$objCommand = new COM ("ADODB.Command");
$objCommand -> ActiveConnection = strConnect;
$objCommand -> CommandText = "someStoredProc";
$objCommand -> CommandType = adCmdStoredProc;

$objParam = $objCommand -> CreateParameter("strAction", adVarChar, adParamInput, 1);
$objCommand -> Parameters -> Append($objParam);
$objParam = $objCommand -> CreateParameter("intCategoryID", adInteger, adParamInput, 4);
$objCommand -> Parameters -> Append($objParam);
$objParam = $objCommand -> CreateParameter("strCategory", adVarChar, adParamInput, 100);
$objCommand -> Parameters -> Append($objParam);

$clnParameter = $objCommand -> Parameters;

echo gettype($clnParameter);

The display says $clnParameter is an object, while ADODB documentation says "Parameters" is a collection of Parameter object.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-27 06:00 UTC] phanto@php.net
and the collection itself is an object, so nothing is wrong here.
you should be able to use $clnParameter->Next() to retrieve the next element or $clnParameter->Next($clnParameter->Count()) to get an array containing all parameters
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Aug 14 01:05:46 2022 UTC