note 76598 added to function.mysql-fetch-array
| From: | joaocosta at zonalivre dot org | Date: | Sun, 22 Jul 2007 02:29:52 +0000 |
| Subject: | note 76598 added to function.mysql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128809@lists.php.net to get a copy of this message | ||
You can make the function on the previous note slightly more efficient by using php's built in
array_push function instead of a foreach loop:
<?php
function mysql_fetch_rowsarr($result, $numass=MYSQL_BOTH) {
$got=array();
mysql_data_seek($result, 0);
while ($row = mysql_fetch_array($result, $numass)) {
array_push($got, $row);
}
return $got;
}
?>
----
Server IP: 194.145.210.3
Probable Submitter: 172.202.8.164
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-array.php
Edit -- https://master.php.net/note/edit/76598
Del: integrated -- https://master.php.net/note/delete/76598/integrated
Del: useless -- https://master.php.net/note/delete/76598/useless
Del: bad code -- https://master.php.net/note/delete/76598/bad+code
Del: spam -- https://master.php.net/note/delete/76598/spam
Del: non-english -- https://master.php.net/note/delete/76598/non-english
Del: in docs -- https://master.php.net/note/delete/76598/in+docs
Del: other reasons-- https://master.php.net/note/delete/76598
Reject -- https://master.php.net/note/reject/76598
Search -- https://master.php.net/manage/user-notes.php