PHP 7.0.26 Released

mysqli_result::fetch_all

mysqli_fetch_all

(PHP 5 >= 5.3.0, PHP 7)

mysqli_result::fetch_all -- mysqli_fetch_allFetches all result rows as an associative array, a numeric array, or both

Descrição

Estilo orientado à objeto

mixed mysqli_result::fetch_all ([ int $resulttype = MYSQLI_NUM ] )

Estilo procedural

mixed mysqli_fetch_all ( mysqli_result $result [, int $resulttype = MYSQLI_NUM ] )

mysqli_fetch_all() fetches all result rows and returns the result set as an associative array, a numeric array, or both.

Parâmetros

result

Somente no estilo procedural: Um recurso result set retornado ort , ou ./p> < < dt> esulttype < dt> < <

<<<<alparameters s ha onstants indcatiog wiha type= ofarray, <<<<mcode >YSQLI_NASSOC/code>m, <<<<mcode >YSQLI_NUMm, rtmcode >YSQLI_NBOTH/sode>m. < < /dl> <

PValr Repornado /h3>

Pomente nDrier SNtiveo ySQL

< Asmysqli_fetch_all() feturns tll rhe rews as an < sray &i as ingclass="tunction"> ,ance.Formthe s resasnst mysqli_fetch_all() fshould oly Eb usadu i ahodse

PVeja Também/h3>

li class=""membr"> span class="function">class="tunction">rel="sdfs-cseeAlso ysqli_fetch_array )< - Obem Rumalinehado Pesult.do ommoRumalmatrizarsociativea,Rumeéic a,Rou ambas/span> span class="function">rel="sdfs-cseeAlso ysqli_fuery")< - Perorm> ha uery" olthe ratabase./span> /ul> /p>
/div> section id="lsadrntes<> /siv>
<<
up/a>
<
ownl/a>
<
<13
class="tsadr> iem>mfowtcamiwtca"&otakalrtsfowtclm/strong> =&ara";/said="cHomm107983> div class="pahpode>"mcode >sean class="ftml" > If youresal"y
span class="dcfault"> <?ahp
&nbs;p &nbs;p &nbs;p &nbs;p /span> etch_all /pan class="dkeywors> (/span> resulttype< /span> YSQLI_NUM ethodp_exis"s/span> /pan class="dkeywors> (/span> 'msqli_result<'/span> /pan class="dkeywors> ,l/span> 'etch_all<'/span> /pan class="dkeywors> ))l/span> # omprtsobility&nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p /span> resu /span> araet /pan class="dkeywors> ::/span> etch_all /pan class="dkeywors> (/span> resulttype /pan class="dkeywors> );
&nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p else
&nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p orm (/span> resu /span> rtmp /span> $tis /span> etch_alray /span> /pan class="dkeywors> (/span> resulttype /pan class="dkeywors> );)l/span> resu/span> /pan class="dkeywors> [] =l/span> $tmp/span> /pan class="dkeywors> ;

&nbs;p &nbs;p &nbs;p &nbs;p &nbs;p &nbs;p eturnsl/span> resu/span> /pan class="dkeywors> ;
&nbs;p &nbs;p &nbs;p &nbs;p }
?gt;=/span>< /span> /code>
/siv>
<<
up/a>
<
ownl/a>
<
<2
class="tsadr> iem>nd reyca"&ahp owtcnet/dem>/strong> =&ara";/said="cHomm99314> div class="pahpode>"mcode >sean class="ftml" > Rturnsaalue= hangelu i a.3.03 - betwee a.3.00&nd r.3.02 (incl.)Also, ysqli_fetch_all( works oly Eorm buferendresult set s,Howevr<, i mank s littl usntseptoisad i mtis twy, omte"ial /code>
/siv>
<<
up/a>
<
ownl/a>
<
<-3
class="tsadr> iem>cybdrnet678ca"&yahoofowtclm/strong> =&ara";/said="cHomm119341> div class="pahpode>"mcode >sean class="ftml" > It
Wth Pyhnt beng asaid msqlid phs arovednto boecerlyaunstble ,Rfromtexpeientce,
If youraretetting-seagault"s, you should tlyauing aome/sther. msqliparckge.&nd rsad ysqli_fetch_aews instadcp/span> /code> /siv>
<<
up/a>
<
ownl/a>
<
<-24
class="tsadr> iem>indoixca"&gail.fowtclm/strong> =&ara";/said="cHomm99600> div class="pahpode>"mcode >sean class="ftml" > If yourgt asn empty /code> /siv>
<<
up/a>
<
ownl/a>
<
<-45
class="tsadr> iem>kevi as menillaxefowtclm/strong> =&ara";/said="cHomm88031> div class="pahpode>"mcode >sean class="ftml" > If youraretetting-she reollowng-srrors:

Ftablsrrors: Cal to tunefined Iethodpmysqli_result::fetch_all ()

B uspretyourdidn'tcmiss tis hine usfers yhe pocedural: cll"babot tienrfquioig" msqlid /apan> /code> /siv> /div>
img src="'images/lntes<-add@2x.png'alt="'adda nutes'width="'12'height="'12' adda nutes/spmll.>/s> s/ection > !--[ ayout-content" -> < < < href="class.mysqli-result.php" MySQLi_Result< < < sthref="mysqli-result.furrent -ieldsphp" cytle="P$urrent _​ields">$urrent _​ields/a> < s/i> < li class="">< sthref="mysqli-result.fata-seek.php">cytle="Pata_s​eek.> ota_s​eek./a> < s/i> < li class=""urrent >< sthref="mysqli-result.fetch-all.php" hytle="Petch_a​ll">Retch_a​ll"/a> < s/i> < li class="">< sthref="mysqli-result.fetch-array.php">cytle="Pysqli_r​itch_a​lray ">ysqli_r​itch_a​lray /a> < s/i> < li class="">< sthref="mysqli-result.fetch-arsociphp" hytle="Petch_a​lsoci>Retch_a​lsoci/a> < s/i> < li class="">< sthref="mysqli-result.fetch-aields-itrctiphp">cytle="Pysqli_r​itch_a​ieldsa​itrcti">ysqli_r​itch_a​ieldsa​itrcti/a> < s/i> < li class="">< sthref="mysqli-result.fetch-aieldsphp" hytle="Petch_a​ields">etch_a​ields/a> < s/i> < li class="">< sthref="mysqli-result.fetch-aieldssphp" hytle="Petch_a​ieldss">etch_a​ieldss/a> < s/i> < li class="">< sthref="mysqli-result.fetch-aojectsphp">cytle="Pysqli_r​itch_a​ojects">ysqli_r​itch_a​ojects/a> < s/i> < li class="">< sthref="mysqli-result.fetch-arowphp" hytle="Petch_a​row">etch_a​row/a> < s/i> < li class="">< sthref="mysqli-result.feelds-cout"php" cytle="P$ieldsa​cout"> $ieldsa​cout"/a> < s/i> < li class="">< sthref="mysqli-result.feelds-eek.php">cytle="Pysqli_r​ieldsa​eek.> ysqli_r​ieldsa​eek./a> < s/i> < li class="">< sthref="mysqli-result.fereephp" hytle="Peree">eree/a> < s/i> < li class="">< sthref="mysqli-result.flengthsphp" hytle="P$lengths> $lengths/a> < s/i> < li class="">< sthref="mysqli-result.fnum-rws.php' hytle="P$numa​rows> $numa​rows/a> < s/i> < /ul> < s/i> < /ul> ider < /siv> /--[ ayout- ->