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.mssql-next-result.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.mssql.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.mssql-next-result.php',
   
1 => 'mssql_next_result',
  ),
 
'up' =>
  array (
   
0 => 'ref.mssql.php',
   
1 => 'Mssql Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.mssql-min-message-severity.php',
   
1 => 'mssql_min_message_severity',
  ),
 
'next' =>
  array (
   
0 => 'function.mssql-num-fields.php',
   
1 => 'mssql_num_fields',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.mssql-next-result" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mssql_next_result</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PECL odbtp &gt;= 1.1.1)</p><p class="refpurpose"><span class="refname">mssql_next_result</span> &mdash; <span class="dc-title">Move the internal result pointer to the next result</span></p>

 </div>
 
 <a name="function.mssql-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>mssql_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">
   When sending more than one SQL statement to the server or
   executing a stored procedure with multiple results, it will cause
   the server to return multiple result sets. This function will
   test for additional results available form the server. If an
   additional result set exists it will free the existing result set
   and prepare to fetch the rows from the new result set.
  </p>
 </div>


 <a name="function.mssql-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 resource that is being evaluated. This result comes from a
       call to <a href="function.mssql-query.php" class="function">mssql_query()</a>.
      </p>
     </dd>

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


 <a name="function.mssql-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 an additional result set was available or <b><tt class="constant">FALSE</tt></b>
   otherwise.
  </p>
 </div>


 <a name="function.mssql-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>mssql_next_result()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Connect&nbsp;MSSQL<br /></span><span style="color: #0000BB">$link&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mssql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'MANGO\SQLEXPRESS'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'sa'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'phpfi'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">mssql_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">'php'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Send&nbsp;a&nbsp;query&nbsp;to&nbsp;MSSQL<br /></span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'SELECT&nbsp;[name],&nbsp;[age]&nbsp;FROM&nbsp;[php].[dbo].[persons]'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mssql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Iterate&nbsp;through&nbsp;returned&nbsp;records<br /></span><span style="color: #007700">do<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;while(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mssql_fetch_row</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Handle&nbsp;record&nbsp;...<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}<br />}<br />while(</span><span style="color: #0000BB">mssql_next_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">//&nbsp;Clean&nbsp;up<br /></span><span style="color: #0000BB">mssql_free_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">mssql_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

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


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