在PHP中调用MS SQL存储过程
-
FunktiongenerateDocCode(){
-
$wf_id=self::WORKFLOW_ID;
-
$doc_code="";
-
-
$link=mssql_connect($this->cfg- >db->params->host,$this->cfg->db->params->username,$ dies->cfg->db->params->password)odersterben("Can'tconnectsqlserver");
-
mssql_select_db($this- >cfg->db->params->dbname,$link)oderdie("Selectdatabasefailure");
-
-
$stmt=mssql_init("GenerateDocCode",$link)odersterben( "initializestoredprocedurefailure");
-
mssql_bind($stmt," @wf_id",$wf_id,SQLINT4);
-
mssql_bind($stmt ,"@doc_code",$doc_code,SQLVARCHAR,true);
-
mssql_execute($stmt,false);
-
- //print"DocCodeis:".$ doc_code;
-
return$doc_code;
- }
先调用mssql_init语句用于初始化存储过程,而后调用mssql_bind语句指定存储过程参数,最后调用mssql_execute执行 🎜>
以上就介绍了PHP调用MS SQL 存储过程, 包括了存储过程, sqlserver方面的内容, 希望对PHP教程有兴趣的朋友有所帮助.