Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Not pulling recordset

Status
Not open for further replies.

Ambrotos

Programmer
Mar 8, 2004
10
0
0
CA
Folks,

I have a situation... I am using a MSSQL stored procedure to pull recordsets for a php page. I am naturally using PHP to activate this stored procedure.

However I cannot get to to go through the while loop i am using to pull the info. It doesn't even print the results when i get it to grab just the last row.

Here is a copy of my code...

$PULLINFO=mssql_init("sp_empCreationsearch");
mssql_bind($PULLINFO,"@strYear",&$YEARSELECTED, SQLVARCHAR);
mssql_bind($PULLINFO,"@strMonth",&$MONTHSELECTED, SQLVARCHAR);
mssql_bind($PULLINFO,"@strPein",&$EMPSELECTED, SQLVARCHAR);
mssql_bind($PULLINFO,"@strSystem",&$SYSSELECTED, SQLVARCHAR);
$PULLINFO2 = mssql_execute($PULLINFO);

while($PULLINFO3 = ssql_fetch_row($PULLINFO2)){
$PERSON = $PULLINFO3[1];
$CALLS = $PULLINFO3[2];
echo"$PERSON $CALLS<BR>";
}


any assistance would be greatly appreciated.

Thanks

Angel
 
In your mssql_bind() invocations, I notice you're passing references to all your variables. Are all of these output parameters?


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Nope... Just parameters I'm passing to it to get the data.
 
I've figured it out. What I need to do is set the variables with a value of "" to a value of " " (with a space in it). I don't know why this works but it does. Might have to do with how the stored procedure was written.

Thanks for your help!!
 
Maybe your wild eye theory isn't so wild OR eye at all. Cuz when I ran the stored procedure in Query Analyzer it returns the recordset properly.

Just another one of those things that make you go hmmm... (god I hate being a product of the 80s)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top