PHP MSSQL 存储过程的方法
前端之家收集整理的这篇文章主要介绍了
PHP MSSQL 存储过程的方法,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<div class="codetitle"><a style="CURSOR: pointer" data="8127" class="copybut" id="copybut8127" onclick="doCopy('code8127')"> 代码如下:
<div class="codebody" id="code8127">
function generateDocCode() {
$wf_id = self::WORKFLOW_ID;
$doc_code = "";
$link = ms
sql_connect($this->cfg->db->params->host,$this->cfg->db->params->username,$this->cfg->db->params->password) or die("Can't connect
sql server");
ms
sql_select_db($this->cfg->db->params->dbname,$link) or die("Select database failure");
$stmt = ms
sql_init("GenerateDocCode",$link) or die("initialize stored procedure failure");
ms
sql_bind($stmt,"@wf_id",$wf_id,
sqlINT4);
ms
sql_bind($stmt,"@doc_code",$doc_code,
sqlVARCHAR,true);
ms
sql_execute($stmt,false);
//print "Doc Code is: ".$doc_code;
return $doc_code;
}