PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
mssql query analyser returns results,while php doesnt return

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR
View previous topic :: View next topic  
Author Message
darksniperx



Joined: 29 Jan 2009
Posts: 2

PostPosted: Thu Jan 29, 2009 5:54 pm    Post subject: mssql query analyser returns results,while php doesnt return Reply with quote

Hello,

I run the query(stored procedure) in mssql query analyser , everything works and I get an output. When I run the same code in php and I do print_r, I get an array that contains my query with no results. Maybe I need to turn on some features in pear mdb2 so that I could see the results from running a stored procedure.

Code:

$qry = $mdb2->query("SET ANSI_NULLS ON; EXEC GetItems @item='1', @page=2");


Quote:
I have pear mdb2 mssql 1.2.1 installed
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Thu Jan 29, 2009 11:04 pm    Post subject: Reply with quote

You're looking for executeStoredProc():
http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Function_Common.html#methodexecuteStoredProc
Back to top
View user's profile Send private message
darksniperx



Joined: 29 Jan 2009
Posts: 2

PostPosted: Thu Jan 29, 2009 11:39 pm    Post subject: Reply with quote

mark wrote:
You're looking for executeStoredProc():
http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Function_Common.html#methodexecuteStoredProc


executeStoredProcedure() complains on "ON" when I run the following code:

Code:

$qry = $mdb2->func->query("SET ANSI_NULLS ON; EXEC GetItems", $input);


If I dont add "SET ANSI_NULLS ON"

Code:

$qry = $mdb2->func->query("GetItems", $input);

I get the following error:

Code:

[Native message: Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.]

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement