Welcome Guest, Not a member yet? Register   Sign In
SQLSRV Multiple Results from SP
#2

[eluser]mobs6[/eluser]
i'have already faced the same problem too with CI active record.
as i sugggested from my long searching on Goog's, theres only one solution that's really worked for me.
Read this basic post:
http://developer99.blogspot.com/2011/07/...m-php.html

this is the example how i used my CI to called out my SP in MSSQL 2008:

Sp Name was : EXEC CREATEPRODUCT
In : ProductNamee, Price , @ProductCode, MerchantId

Please read this part, which paramater u want to set as the output:
$addProduct = $this->db->query("
DECLARE @ProductCode as varchar (100) ;
EXEC CREATEPRODUCT
'$pname', '$price',
@ProductCode OUTPUT,
'$merchantId';
select @ProductCode;
")->result_array();



$productCode = $addProduct[0][0];

Note: in my experience of using mssql DB with PHP, after doing some query or etc..dont forget always close DB conection. in CI just used $this->db->close();
it will reduce memory usage of MSSQL SERVER.

ok hope it will help




Messages In This Thread
SQLSRV Multiple Results from SP - by El Forum - 05-02-2012, 08:31 AM
SQLSRV Multiple Results from SP - by El Forum - 06-09-2012, 11:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB