Home > Backend Development > PHP Tutorial > PHP MSSQL stored procedure method_PHP tutorial

PHP MSSQL stored procedure method_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:48:02
Original
1140 people have browsed it

Copy code The code is as follows:

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;
}

First call the mssql_init statement to initialize the stored procedure, and then call the mssql_bind statement to specify the stored procedure parameters , and finally call mssql_execute to execute the stored procedure.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319864.htmlTechArticleCopy the code as follows: function generateDocCode() { $wf_id = self::WORKFLOW_ID; $doc_code = ""; $link = mssql_connect($this-cfg-db-params-host, $this-cfg-db-params-username, $t...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template