mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
130 lines
8.9 KiB
HTML
130 lines
8.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Executes a stored procedure on a MS SQL server database</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.mssql-execute" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">mssql_execute</h1>
|
|
<p class="verinfo">(PHP 4 >= 4.0.7, PHP 5, PECL odbtp >= 1.1.1)</p><p class="refpurpose"><span class="refname">mssql_execute</span> — <span class="dc-title">Executes a stored procedure on a MS SQL server database</span></p>
|
|
|
|
</div>
|
|
|
|
<div id="function.mssql-execute-refsynopsisdiv">
|
|
<div class="warning"><strong class="warning">Warning</strong>
|
|
|
|
<p class="para">
|
|
This function was <em class="emphasis">REMOVED</em> in PHP 7.0.0.
|
|
</p>
|
|
<p class="para">
|
|
Alternatives to this function include:
|
|
</p>
|
|
|
|
<ul class="simplelist">
|
|
<li class="member">
|
|
Using an <em>EXEC</em> query issued through
|
|
<a href="ref.pdo_sqlsrv.html" class="link">PDO_SQLSRV</a>,
|
|
<a href="ref.pdo_odbc.html" class="link">PDO_ODBC</a>,
|
|
<a href="book.sqlsrv.html" class="link">SQLSRV</a>, or the
|
|
<a href="book.uodbc.html" class="link">unified ODBC driver</a>.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.mssql-execute-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>mssql_execute</strong></span>
|
|
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$stmt</code></span>
|
|
[, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$skip_results</code><span class="initializer"> = <strong><code>FALSE</code></strong></span></span>
|
|
] ) : <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Executes a stored procedure on a MS SQL server database
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.mssql-execute-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">stmt</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Statement handle obtained with <span class="function"><a href="mssql_init.html" class="function">mssql_init()</a></span>.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">skip_results</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Whenever to skip the results or not.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.mssql-execute-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-1750">
|
|
<p><strong>Example #1 <span class="function"><strong>mssql_execute()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Create a new statement<br /></span><span style="color: #0000BB">$stmt </span><span style="color: #007700">= </span><span style="color: #0000BB">mssql_init</span><span style="color: #007700">(</span><span style="color: #DD0000">'NewBlogEntry'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Some data strings<br /></span><span style="color: #0000BB">$title </span><span style="color: #007700">= </span><span style="color: #DD0000">'Test of blogging system'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$content </span><span style="color: #007700">= </span><span style="color: #DD0000">'If you can read this, then the new system is compatible with MSSQL'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Bind values<br /></span><span style="color: #0000BB">mssql_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">, </span><span style="color: #DD0000">'@author'</span><span style="color: #007700">, </span><span style="color: #DD0000">'Felipe Pena'</span><span style="color: #007700">, </span><span style="color: #0000BB">SQLVARCHAR</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">60</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">mssql_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">, </span><span style="color: #DD0000">'@date'</span><span style="color: #007700">, </span><span style="color: #DD0000">'08/10/2008'</span><span style="color: #007700">, </span><span style="color: #0000BB">SQLVARCHAR</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">20</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">mssql_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">, </span><span style="color: #DD0000">'@title'</span><span style="color: #007700">, </span><span style="color: #0000BB">$title</span><span style="color: #007700">, </span><span style="color: #0000BB">SQLVARCHAR</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">60</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">mssql_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">, </span><span style="color: #DD0000">'@content'</span><span style="color: #007700">, </span><span style="color: #0000BB">$content</span><span style="color: #007700">, </span><span style="color: #0000BB">SQLTEXT</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Execute the statement<br /></span><span style="color: #0000BB">mssql_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// And we can free it like so:<br /></span><span style="color: #0000BB">mssql_free_statement</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 notes" id="refsect1-function.mssql-execute-notes">
|
|
<h3 class="title">注释</h3>
|
|
<blockquote class="note"><p><strong class="note">Note</strong>:
|
|
<p class="para">
|
|
If the stored procedure returns parameters or a return value these will
|
|
be available after the call to <span class="function"><strong>mssql_execute()</strong></span> unless
|
|
the stored procedure returns more than one result set. In that case
|
|
use <span class="function"><a href="mssql_next_result.html" class="function">mssql_next_result()</a></span> to shift through the results.
|
|
When the last result has been processed the output parameters and return
|
|
values will be available.
|
|
</p>
|
|
</p></blockquote>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.mssql-execute-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="mssql_bind.html" class="function" rel="rdfs-seeAlso">mssql_bind()</a> - Adds a parameter to a stored procedure or a remote stored procedure</span></li>
|
|
<li class="member"><span class="function"><a href="mssql_free_statement.html" class="function" rel="rdfs-seeAlso">mssql_free_statement()</a> - Free statement memory</span></li>
|
|
<li class="member"><span class="function"><a href="mssql_init.html" class="function" rel="rdfs-seeAlso">mssql_init()</a> - Initializes a stored procedure or a remote stored procedure</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |