Hello Everyone,
I am having difficulty looping through an array of stored procedures.
The issue:
Array with x number of stored procedures
Column names identical in all Stored procedures (PO_Date, PO_Data, PO_Pointer)
Each stored procedure has three inputs pi_pid, pi_from, pi_thru
Must execute each stored procedure in the array
Must store values like so:
$spDate[$i] = $row['PO_Date'];
$spData[$i] = $row['PO_Data'];
$spPointer[$i] = $row['PO_Pointer'];
$i++;
I was able to get one stored procedure to work with the code below:
$stmt = mssql_init("test");
mssql_bind($stmt, "@pi_person", $SQL_pid, SQLVARCHAR, FALSE, FALSE, 36);
mssql_bind($stmt, "@pi_from", $from, SQLVARCHAR, FALSE, FALSE, 8);
mssql_bind($stmt, "@pi_thru", $thru, SQLVARCHAR, FALSE, FALSE, 8);
$result = mssql_execute($stmt);
if (mssql_num_rows($result)>0) {
$i = 0; $arrDate; $arrDetail; $arrFileName;
while ($row=mssql_fetch_assoc($result)) {
$arrDate[$i] = $row['PO_Date'];
$arrDetail[$i] = $row['PO_Data'];
$arrFileName[$i] = $row['PO_Pointer'];
$i++;
}
}
if ($arrDate[0]!='') {
$iIndex=0;
echo $arrDate[$iIndex]."<br>".$arrDetail[$iIndex]."<br>";
$iIndex++;
}
Setup:
Windows server 2008
MSSQL server 2005
PHP ver 4.3.3
Any and all help would be much appreciated.