Source of: /manual/en/function.ingres-fetch-row.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ingres.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.ingres-fetch-row.php',
1 => 'ingres_fetch_row',
),
'up' =>
array (
0 => 'ref.ingres.php',
1 => 'Ingres Functions',
),
'prev' =>
array (
0 => 'function.ingres-fetch-proc-return.php',
1 => 'ingres_fetch_proc_return',
),
'next' =>
array (
0 => 'function.ingres-field-length.php',
1 => 'ingres_field_length',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.ingres-fetch-row" class="refentry">
<div class="refnamediv">
<h1 class="refname">ingres_fetch_row</h1>
<p class="verinfo">(PHP 4 >= 4.0.2, PHP 5 <= 5.0.5, PECL ingres >= 1.0.0)</p><p class="refpurpose"><span class="refname">ingres_fetch_row</span> — <span class="dc-title">Fetch a row of result into an enumerated array</span></p>
</div>
<a name="function.ingres-fetch-row.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">array</span> <span class="methodname"><b>ingres_fetch_row</b></span>
( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$result</tt></span>
)</div>
<p class="para rdfs-comment">
<b>ingres_fetch_row()</b> returns an array that
corresponds to the fetched row, or <b><tt class="constant">FALSE</tt></b> if there are no more
rows. Each result column is stored in an array offset, starting
at offset 1.
</p>
<p class="para">
Subsequent calls to <b>ingres_fetch_row()</b>
return the next row in the result set, or <b><tt class="constant">FALSE</tt></b> if there are no
more rows.
</p>
<p class="para">
By default, arrays created by <b>ingres_fetch_row()</b> start
from position 1 and not 0 as with other DBMS extensions. The starting position
can be adjusted to 0 using the configuration parameter <a href="ingres.configuration.php#ini.ingres.array-index-start" class="link">ingres.array_index_start</a>.
</p>
<blockquote><p><b class="note">Note</b>:
<b>Related Configurations</b><br />
See also the <a href="ingres.configuration.php#ini.ingres.array-index-start" class="link">ingres.array_index_start</a>, <a href="ingres.configuration.php#ini.ingres.fetch-buffer-size" class="link">ingres.fetch_buffer_size</a>
and <a href="ingres.configuration.php#ini.ingres.utf8" class="link">ingres.utf8</a>
directives in <a href="ingres.configuration.php" class="link">Runtime
Configuration</a>.
<br />
</p></blockquote>
</div>
<a name="function.ingres-fetch-row.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</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The query result identifier
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.ingres-fetch-row.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns an array that corresponds to the fetched row,
or <b><tt class="constant">FALSE</tt></b> if there are no more rows
</p>
</div>
<a name="function.ingres-fetch-row.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 Fetch a row of result into an enumerated array</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br />$link </span><span style="color: #007700">= </span><span style="color: #0000BB">ingres_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">, </span><span style="color: #0000BB">$user</span><span style="color: #007700">, </span><span style="color: #0000BB">$password</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">ingres_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">, </span><span style="color: #DD0000">"select * from table"</span><span style="color: #007700">);<br />while (</span><span style="color: #0000BB">$row </span><span style="color: #007700">= </span><span style="color: #0000BB">ingres_fetch_row</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">)) {<br /> echo </span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">];<br /> echo </span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">];<br />}<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
</div><p>
</p>
</div>
<a name="function.ingres-fetch-row.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.ingres-num-fields.php" class="function" rel="rdfs-seeAlso">ingres_num_fields()</a> - Get the number of fields returned by the last query</li>
<li class="member"><a href="function.ingres-query.php" class="function" rel="rdfs-seeAlso">ingres_query()</a> - Send an SQL query to Ingres</li>
<li class="member"><a href="function.ingres-fetch-array.php" class="function" rel="rdfs-seeAlso">ingres_fetch_array()</a> - Fetch a row of result into an array</li>
<li class="member"><a href="function.ingres-fetch-assoc.php" class="function" rel="rdfs-seeAlso">ingres_fetch_assoc()</a> - Fetch a row of result into an associative array</li>
<li class="member"><a href="function.ingres-fetch-object.php" class="function" rel="rdfs-seeAlso">ingres_fetch_object()</a> - Fetch a row of result into an object</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>