<!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>Get the number of rows affected or returned by a query</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ingres-num-fields.html">ingres_num_fields</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ingres-pconnect.html">ingres_pconnect</a></div> <div class="up"><a href="ref.ingres.html">Ingres Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.ingres-num-rows" class="refentry"> <div class="refnamediv"> <h1 class="refname">ingres_num_rows</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_num_rows</span> — <span class="dc-title">Get the number of rows affected or returned by a query</span></p> </div> <div class="refsect1 description" id="refsect1-function.ingres-num-rows-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">int</span> <span class="methodname"><strong>ingres_num_rows</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span> )</div> <p class="para rdfs-comment"> This function primarily is meant to get the number of rows modified in the database. However, it can be used to retrieve the number of rows to fetch for a SELECT statement. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> If <a href="ingres.configuration.html#ini.ingres.scrollable" class="link">scrollable cursors</a> are disabled and this function is called before using <span class="function"><a href="function.ingres-fetch-array.html" class="function">ingres_fetch_array()</a></span>, <span class="function"><a href="function.ingres-fetch-object.html" class="function">ingres_fetch_object()</a></span>, or <span class="function"><a href="function.ingres-fetch-row.html" class="function">ingres_fetch_row()</a></span>, the server will delete the result's data and the script will be unable to get them. </p> <p class="para"> Instead, you should retrieve the result's data using one of these fetch functions in a loop until it returns <strong><code>FALSE</code></strong>, indicating that no more results are available. </p> </p></blockquote> </div> <div class="refsect1 parameters" id="refsect1-function.ingres-num-rows-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">result</code></em></span> <dd> <p class="para"> The result identifier for a query </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.ingres-num-rows-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> For delete, insert, or update queries, <span class="function"><strong>ingres_num_rows()</strong></span> returns the number of rows affected by the query. For other queries, <span class="function"><strong>ingres_num_rows()</strong></span> returns the number of rows in the query's result. </p> </div> <div class="refsect1 seealso" id="refsect1-function.ingres-num-rows-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.ingres-query.html" class="function" rel="rdfs-seeAlso">ingres_query()</a> - Send an SQL query to Ingres</span></li> <li class="member"> <span class="function"><a href="function.ingres-fetch-array.html" class="function" rel="rdfs-seeAlso">ingres_fetch_array()</a> - Fetch a row of result into an array</span></li> <li class="member"> <span class="function"><a href="function.ingres-fetch-assoc.html" class="function" rel="rdfs-seeAlso">ingres_fetch_assoc()</a> - Fetch a row of result into an associative array</span></li> <li class="member"> <span class="function"><a href="function.ingres-fetch-object.html" class="function" rel="rdfs-seeAlso">ingres_fetch_object()</a> - Fetch a row of result into an object</span></li> <li class="member"> <span class="function"><a href="function.ingres-fetch-row.html" class="function" rel="rdfs-seeAlso">ingres_fetch_row()</a> - Fetch a row of result into an enumerated array</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ingres-num-fields.html">ingres_num_fields</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ingres-pconnect.html">ingres_pconnect</a></div> <div class="up"><a href="ref.ingres.html">Ingres Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>