note 76598 deleted from function.mysql-fetch-array by levim

From: Date: Fri, 06 Dec 2013 21:28:26 +0000
Subject: note 76598 deleted from function.mysql-fetch-array by levim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-197821@lists.php.net to get a copy of this message
Note Submitter: joaocosta at zonalivre dot org ---- 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; } ?>

« previous php.notes (#197821) next »