Calling Stored Procedure using ADODB in PHP

人盡茶涼 提交于 2019-12-02 00:48:59

OK. I found the answer myself. There is no clean way to do that in ADODB for MySQL. The PrepareSP() method can be used, but not the InParameter or the OutParameter methods.

The ADODB documentation says:

InParameter() is a wrapper function that calls Parameter() with $isOutput=false. The advantage of this function is that it is self-documenting, because the $isOutput parameter is no longer needed. Only for mssql and oci8 currently.

OutParameter() is a wrapper function that calls Parameter() with $isOutput=true. The advantage of this function is that it is self-documenting, because the $isOutput parameter is no longer needed. Only for mssql and oci8 currently.

I have done this through by Adodb library check out this.. $addProduct = $obj->ExecuteQuery("Begin;DECLARE @ProductCode as varchar (100) ;EXEC CREATEPRODUCT'$pname', '$price', @ProductCode OUTPUT, '$merchantId';select @ProductCode;End;");

for complete explanation you can check out this http://developer99.blogspot.com/2011/07/calling-ms-sql-sp-from-php.html

ederrafo

this option to also use it:

  • $rs = $db->Execute($stmt);
  • $rsstmt = $db->Execute($rsstmt);

seems appropriate, because PrepareSP () is used adodb and oracle. I have not had any luck trying the same adodb library and mysql. as you did your Nirmal.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!