无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
function generateDocCode() {
$wf_id = self::WORKFLOW_ID;
$doc_code = "";
$link = mssql_connect($this->cfg->db->params->host, $this->cfg->db->params->username, $this->cfg->db->params->password) or die("Can't connect sql server");
mssql_select_db($this->cfg->db->params->dbname, $link) or die("Select database failure");
$stmt = mssql_init("GenerateDocCode", $link) or die("initialize stored procedure failure");
mssql_bind($stmt, "@wf_id", $wf_id, SQLINT4);
mssql_bind($stmt, "@doc_code", $doc_code, SQLVARCHAR, true);
mssql_execute($stmt, false);
//print "Doc Code is: ".$doc_code;
return $doc_code;
}

先调用mssql_init语句用于初始化存储过程,而后调用mssql_bind语句指定存储过程参数,最后调用mssql_execute执行存储过程。
标签:
PHP,MSSQL,存储过程

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com