note 35682 added to function.mysql-fetch-row

From: Date: Thu, 11 Sep 2003 02:19:03 +0000
Subject: note 35682 added to function.mysql-fetch-row
Groups: php.notes 
Request: Send a blank email to php-notes+get-56040@lists.php.net to get a copy of this message
This one: function mysql_buffered_query($data_select, $data_connection) { $sql_query = mysql_query($data_select, $data_connection); $sql_num_fields = mysql_num_fields($sql_query); $info_rows = 0; while($sql_fetch_rows = mysql_fetch_row($sql_query)) { $info_offset = 1; $info_columns = 0; while ($info_offset <= $sql_num_fields) { $info_elements[$info_rows][$info_columns] = $sql_fetch_rows[$info_columns]; $info_offset++; $info_columns++; } $info_rows++; } return $info_elements; } Can be written as: function mysql_buffered_query($data_select, $data_connection) { $sql_query = mysql_query($data_select, $data_connection); while($tmp = mysql_fetch_row($sql_query)) { $info_elements[]=$tmp; } } ---- Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-row.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35682 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35682&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35682&report=yes

« previous php.notes (#56040) next »