mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-19 14:22:43 +08:00
96 lines
8.1 KiB
HTML
96 lines
8.1 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>Checks if multiple results are available</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.odbc-next-result" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">odbc_next_result</h1>
|
|
<p class="verinfo">(PHP 4 >= 4.0.5, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">odbc_next_result</span> — <span class="dc-title">Checks if multiple results are available</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.odbc-next-result-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>odbc_next_result</strong></span>
|
|
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result_id</code></span>
|
|
) : <span class="type">bool</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Checks if there are more result sets available as well as allowing access
|
|
to the next result set via <span class="function"><a href="odbc_fetch_array.html" class="function">odbc_fetch_array()</a></span>,
|
|
<span class="function"><a href="odbc_fetch_row.html" class="function">odbc_fetch_row()</a></span>, <span class="function"><a href="odbc_result.html" class="function">odbc_result()</a></span>, etc.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.odbc-next-result-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">result_id</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The result identifier.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.odbc-next-result-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns <strong><code>TRUE</code></strong> if there are more result sets, <strong><code>FALSE</code></strong> otherwise.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.odbc-next-result-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-983">
|
|
<p><strong>Example #1 <span class="function"><strong>odbc_next_result()</strong></span></strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br />$r_Connection </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$dsn</span><span style="color: #007700">, </span><span style="color: #0000BB">$username</span><span style="color: #007700">, </span><span style="color: #0000BB">$password</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$s_SQL </span><span style="color: #007700">= <<<END_SQL<br /></span><span style="color: #DD0000">SELECT 'A'<br />SELECT 'B'<br />SELECT 'C'<br /></span><span style="color: #007700">END_SQL;<br /><br /></span><span style="color: #0000BB">$r_Results </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Connection</span><span style="color: #007700">, </span><span style="color: #0000BB">$s_SQL</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$a_Row1 </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$a_Row2 </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"Dump first result set"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$a_Row1</span><span style="color: #007700">, </span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">"Get second results set "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">odbc_next_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$a_Row1 </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$a_Row2 </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"Dump second result set "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$a_Row1</span><span style="color: #007700">, </span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">"Get third results set "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">odbc_next_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$a_Row1 </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$a_Row2 </span><span style="color: #007700">= </span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"Dump third result set "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$a_Row1</span><span style="color: #007700">, </span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">"Try for a fourth result set "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">odbc_next_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程会输出:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
Dump first result set array(1) {
|
|
["A"]=>
|
|
string(1) "A"
|
|
}
|
|
bool(false)
|
|
Get second results set bool(true)
|
|
Dump second result set array(1) {
|
|
["B"]=>
|
|
string(1) "B"
|
|
}
|
|
bool(false)
|
|
Get third results set bool(true)
|
|
Dump third result set array(1) {
|
|
["C"]=>
|
|
string(1) "C"
|
|
}
|
|
bool(false)
|
|
Try for a fourth result set bool(false)
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |