note 72012 added to function.mysqli-stmt-execute
| From: | Typer85 at gmail dot com | Date: | Thu, 28 Dec 2006 22:23:35 +0000 |
| Subject: | note 72012 added to function.mysqli-stmt-execute | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120993@lists.php.net to get a copy of this message | ||
Just to clarify this note in the Manual regarding this function:
"Note: When using mysqli_stmt_execute(), the mysqli_stmt_fetch() function must be used to
fetch the data prior to performing any additional queries."
This is because this function DOES NOT store the result set on the client side so you have to fetch
everything in the result set or else you risk major errors.
If you however use the function mysqli_stmt_store_result immediately after you use this function,
you are forcing the result set to be stored on the client side and thus it is safe to issue extra
queries before fetching all the data.
This is where you really have to make a choice regarding on your application's priorities. If
you know your result set is memory hefty, then its a good idea not to store it on the client side so
you don't run in any errors regarding unavailable memory on the server. But this also means
your not going to do a lot of calculations on the result set or else you will prevent any other
usage of the table to which the result set came from until you fetched it all.
If your going to do a lot of calculations or your result set is not memory hefty, its probably a
good idea to store it on the client side.
Most of these problems can easily be solved if you have a lot of memory available on your server but
thats usually not the case for those on shared hosting.
An intelligent way to counter this problem if your on a shared host is to be smart in the way you
design your queries. Try to limit the result set if you know you will be fetching memory hefty
result sets.
Test different alternatives for your application and see what works best for you under different
conditions.
Good Luck,
----
Server IP: 66.163.161.117
Probable Submitter: 84.36.231.206
----
Manual Page -- http://www.php.net/manual/en/function.mysqli-stmt-execute.php
Edit -- https://master.php.net/note/edit/72012
Del: integrated -- https://master.php.net/note/delete/72012/integrated
Del: useless -- https://master.php.net/note/delete/72012/useless
Del: bad code -- https://master.php.net/note/delete/72012/bad+code
Del: spam -- https://master.php.net/note/delete/72012/spam
Del: non-english -- https://master.php.net/note/delete/72012/non-english
Del: in docs -- https://master.php.net/note/delete/72012/in+docs
Del: other reasons-- https://master.php.net/note/delete/72012
Reject -- https://master.php.net/note/reject/72012
Search -- https://master.php.net/manage/user-notes.php