note 77141 added to function.mysqli-stmt-fetch

From: Date: Thu, 16 Aug 2007 19:14:55 +0000
Subject: note 77141 added to function.mysqli-stmt-fetch
Groups: php.notes 
Request: Send a blank email to php-notes+get-129539@lists.php.net to get a copy of this message
The following function taken from PHP Cookbook 2, returns an associative array of a row in the resultset, place in while loop to iterate through whole result set. <?php public function fetchArray () { $data = mysqli_stmt_result_metadata($this->stmt); $fields = array(); $out = array(); $fields[0] = &$this->stmt; $count = 1; while($field = mysqli_fetch_field($data)) { $fields[$count] = &$out[$field->name]; $count++; } call_user_func_array(mysqli_stmt_bind_result, $fields); mysqli_stmt_fetch($this->stmt); return (count($out) == 0) ? false : $out; } ?> ---- Server IP: 194.145.210.3 Probable Submitter: 86.15.105.255 ---- Manual Page -- http://www.php.net/manual/en/function.mysqli-stmt-fetch.php Edit -- https://master.php.net/note/edit/77141 Del: integrated -- https://master.php.net/note/delete/77141/integrated Del: useless -- https://master.php.net/note/delete/77141/useless Del: bad code -- https://master.php.net/note/delete/77141/bad+code Del: spam -- https://master.php.net/note/delete/77141/spam Del: non-english -- https://master.php.net/note/delete/77141/non-english Del: in docs -- https://master.php.net/note/delete/77141/in+docs Del: other reasons-- https://master.php.net/note/delete/77141 Reject -- https://master.php.net/note/reject/77141 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129539) next »