downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.odbc-next-result.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.uodbc.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.odbc-next-result.php',
   
1 => 'odbc_next_result',
  ),
 
'up' =>
  array (
   
0 => 'ref.uodbc.php',
   
1 => 'ODBC Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.odbc-longreadlen.php',
   
1 => 'odbc_longreadlen',
  ),
 
'next' =>
  array (
   
0 => 'function.odbc-num-fields.php',
   
1 => 'odbc_num_fields',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.odbc-next-result" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">odbc_next_result</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5)</p><p class="refpurpose"><span class="refname">odbc_next_result</span> &mdash; <span class="dc-title">Checks if multiple results are available</span></p>

 </div>
 <a name="function.odbc-next-result.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><b>odbc_next_result</b></span>
    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$result_id</tt></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 <a href="function.odbc-fetch-array.php" class="function">odbc_fetch_array()</a>,
   <a href="function.odbc-fetch-row.php" class="function">odbc_fetch_row()</a>, <a href="function.odbc-result.php" class="function">odbc_result()</a>, etc.
  </p>
 </div>

 <a name="function.odbc-next-result.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">result_id</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The result identifier.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>

 <a name="function.odbc-next-result.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <b><tt class="constant">TRUE</tt></b> if there are more result sets, <b><tt class="constant">FALSE</tt></b> otherwise.
  </p>
 </div>

 <a name="function.odbc-next-result.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 <b>odbc_next_result()</b></b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$r_Connection&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$dsn</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$username</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$password</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$s_SQL&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;END_SQL<br /></span><span style="color: #DD0000">SELECT&nbsp;'A'<br />SELECT&nbsp;'B'<br />SELECT&nbsp;'C'<br /></span><span style="color: #007700">END_SQL;<br /><br /></span><span style="color: #0000BB">$r_Results&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Connection</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$s_SQL</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$a_Row1&nbsp;</span><span style="color: #007700">=&nbsp;</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&nbsp;</span><span style="color: #007700">=&nbsp;</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&nbsp;</span><span style="color: #DD0000">"Dump&nbsp;first&nbsp;result&nbsp;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">,&nbsp;</span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Get&nbsp;second&nbsp;results&nbsp;set&nbsp;"</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&nbsp;</span><span style="color: #007700">=&nbsp;</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&nbsp;</span><span style="color: #007700">=&nbsp;</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&nbsp;</span><span style="color: #DD0000">"Dump&nbsp;second&nbsp;result&nbsp;set&nbsp;"</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">,&nbsp;</span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Get&nbsp;third&nbsp;results&nbsp;set&nbsp;"</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&nbsp;</span><span style="color: #007700">=&nbsp;</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&nbsp;</span><span style="color: #007700">=&nbsp;</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&nbsp;</span><span style="color: #DD0000">"Dump&nbsp;third&nbsp;result&nbsp;set&nbsp;"</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">,&nbsp;</span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Try&nbsp;for&nbsp;a&nbsp;fourth&nbsp;result&nbsp;set&nbsp;"</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">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Dump first result set array(1) {
  [&quot;A&quot;]=&gt;
  string(1) &quot;A&quot;
}
bool(false)
Get second results set bool(true)
Dump second result set array(1) {
  [&quot;B&quot;]=&gt;
  string(1) &quot;B&quot;
}
bool(false)
Get third results set bool(true)
Dump third result set array(1) {
  [&quot;C&quot;]=&gt;
  string(1) &quot;C&quot;
}
bool(false)
Try for a fourth result set bool(false)
</pre></div>
    </div>
   </div><p>
  </p>
 </div>

</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites