note 72015 added to function.mysqli-stmt-bind-result
| From: | Typer85 at gmail dot com | Date: | Fri, 29 Dec 2006 02:18:53 +0000 |
| Subject: | note 72015 added to function.mysqli-stmt-bind-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120997@lists.php.net to get a copy of this message | ||
In response to 'matti at withoutthis dot keller dot com',
Your function works great but there is one thing you should clear up when you say the following:
'# But beware! when using the fetch in a loop, always COPY $result or else you might
# end with all the same values because of the references'.
Can someone explain how exactly to COPY the contents of an array that is referenced?
Myself, I am having a little trouble. In my WHILE LOOP that fetches a result set I have the
following:
<?php
$temp = $result;
?>
This is my understanding of copying an array, unfortunately PHP seems to be referencing $temp to
$result not copying it. So no matter what I do, the end result of my WHILE LOOP is always displaying
the last fetched row because of the references.
Anyone has a solution?
----
Server IP: 66.163.161.117
Probable Submitter: 84.36.231.206
----
Manual Page -- http://www.php.net/manual/en/function.mysqli-stmt-bind-result.php
Edit -- https://master.php.net/note/edit/72015
Del: integrated -- https://master.php.net/note/delete/72015/integrated
Del: useless -- https://master.php.net/note/delete/72015/useless
Del: bad code -- https://master.php.net/note/delete/72015/bad+code
Del: spam -- https://master.php.net/note/delete/72015/spam
Del: non-english -- https://master.php.net/note/delete/72015/non-english
Del: in docs -- https://master.php.net/note/delete/72015/in+docs
Del: other reasons-- https://master.php.net/note/delete/72015
Reject -- https://master.php.net/note/reject/72015
Search -- https://master.php.net/manage/user-notes.php