<!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>The mysqli_result class</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysqli-stmt.store-result.html">mysqli_stmt::store_result</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqli-result.current-field.html">mysqli_result::$current_field</a></div> <div class="up"><a href="book.mysqli.html">Mysqli</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.mysqli-result" class="reference"> <h1 class="title">The mysqli_result class</h1> <div class="partintro"><p class="verinfo">(PHP 5)</p> <div class="section" id="mysqli-result.intro"> <h2 class="title">Introduction</h2> <p class="para"> Represents the result set obtained from a query against the database. </p> <p class="para"> <em class="emphasis">Changelog</em> </p> <table class="doctable table"> <caption><strong>Changelog</strong></caption> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>5.4.0</td> <td> <a href="class.iterator.html" class="classname">Iterator</a> support was added, as <strong class="classname">mysqli_result</strong> now implements <a href="class.traversable.html" class="classname">Traversable</a>. </td> </tr> </tbody> </table> </div> <div class="section" id="mysqli-result.synopsis"> <h2 class="title">Class synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="ooclass"> <strong class="classname">mysqli_result</strong> </span> <span class="oointerface">implements <span class="interfacename"><a href="class.traversable.html" class="interfacename">Traversable</a></span> </span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Properties */</div> <div class="fieldsynopsis"> <span class="type">int</span> <var class="varname"><a href="mysqli-result.current-field.html">$<var class="varname">current_field</var></a></var> ;</div> <div class="fieldsynopsis"><span class="type">int</span> <var class="varname"><a href="mysqli-result.field-count.html">$<var class="varname">field_count</var></a></var>;</div> <div class="fieldsynopsis"><span class="type">array</span> <var class="varname"><a href="mysqli-result.lengths.html">$<var class="varname">lengths</var></a></var>;</div> <div class="fieldsynopsis"><span class="type">int</span> <var class="varname"><a href="mysqli-result.num-rows.html">$<var class="varname">num_rows</var></a></var>;</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><a href="mysqli-result.data-seek.html" class="methodname">data_seek</a></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="type">mixed</span> <span class="methodname"><a href="mysqli-result.fetch-all.html" class="methodname">fetch_all</a></span> ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$resulttype</code><span class="initializer"> = MYSQLI_NUM</span></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="type">mixed</span> <span class="methodname"><a href="mysqli-result.fetch-array.html" class="methodname">fetch_array</a></span> ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$resulttype</code><span class="initializer"> = MYSQLI_BOTH</span></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><a href="mysqli-result.fetch-assoc.html" class="methodname">fetch_assoc</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="type">object</span> <span class="methodname"><a href="mysqli-result.fetch-field-direct.html" class="methodname">fetch_field_direct</a></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$fieldnr</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="type">object</span> <span class="methodname"><a href="mysqli-result.fetch-field.html" class="methodname">fetch_field</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><a href="mysqli-result.fetch-fields.html" class="methodname">fetch_fields</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="type">object</span> <span class="methodname"><a href="mysqli-result.fetch-object.html" class="methodname">fetch_object</a></span> ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$class_name</code></span> [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$params</code></span> ]] )</div> <div class="methodsynopsis dc-description"> <span class="type">mixed</span> <span class="methodname"><a href="mysqli-result.fetch-row.html" class="methodname">fetch_row</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><a href="mysqli-result.field-seek.html" class="methodname">field_seek</a></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$fieldnr</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="type">void</span> <span class="methodname"><a href="mysqli-result.free.html" class="methodname">free</a></span> ( <span class="methodparam">void</span> )</div> }</div> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="mysqli-result.current-field.html">mysqli_result::$current_field</a> — Get current field offset of a result pointer</li><li><a href="mysqli-result.data-seek.html">mysqli_result::data_seek</a> — Adjusts the result pointer to an arbitrary row in the result</li><li><a href="mysqli-result.fetch-all.html">mysqli_result::fetch_all</a> — Fetches all result rows as an associative array, a numeric array, or both</li><li><a href="mysqli-result.fetch-array.html">mysqli_result::fetch_array</a> — Fetch a result row as an associative, a numeric array, or both</li><li><a href="mysqli-result.fetch-assoc.html">mysqli_result::fetch_assoc</a> — Fetch a result row as an associative array</li><li><a href="mysqli-result.fetch-field-direct.html">mysqli_result::fetch_field_direct</a> — Fetch meta-data for a single field</li><li><a href="mysqli-result.fetch-field.html">mysqli_result::fetch_field</a> — Returns the next field in the result set</li><li><a href="mysqli-result.fetch-fields.html">mysqli_result::fetch_fields</a> — Returns an array of objects representing the fields in a result set</li><li><a href="mysqli-result.fetch-object.html">mysqli_result::fetch_object</a> — Returns the current row of a result set as an object</li><li><a href="mysqli-result.fetch-row.html">mysqli_result::fetch_row</a> — Get a result row as an enumerated array</li><li><a href="mysqli-result.field-count.html">mysqli_result::$field_count</a> — Get the number of fields in a result</li><li><a href="mysqli-result.field-seek.html">mysqli_result::field_seek</a> — Set result pointer to a specified field offset</li><li><a href="mysqli-result.free.html">mysqli_result::free</a> — Frees the memory associated with a result</li><li><a href="mysqli-result.lengths.html">mysqli_result::$lengths</a> — Returns the lengths of the columns of the current row in the result set</li><li><a href="mysqli-result.num-rows.html">mysqli_result::$num_rows</a> — Gets the number of rows in a result</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysqli-stmt.store-result.html">mysqli_stmt::store_result</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqli-result.current-field.html">mysqli_result::$current_field</a></div> <div class="up"><a href="book.mysqli.html">Mysqli</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>