php - Cannot execute queries while other unbuffered queries are active -
OK, so I used this website (amateur using PHP 5.4 (working 100%) using a local test server Manner) developed on Remote Host, I have encountered non-stop problems, possibly due to differences in all PHP versions. The remote server uses PHP 5.1 On this page, a value is passed from the previous page and this value is used to fill out a form.
I have detected this problem with trial and error, but he does not know what is happening due to this and what has been read so far there are at least 30 relevant SE questions. Immediate execution on the code generated statement on this page stops. I can not find any type of error message.
I know that the $ link connection is open because I have a query that works perfectly.
if (('POST' === $ _SERVER ['REQUEST_METHOD']) & amp; (isset ($ _ POST ['Description'])) {$ sql = 'From Select * where it is that: = ';'; per second $ sql; $$ query = $ link-> added for testing ($ sql); resonance "it never shows"; // Verified problem area $ query- & gt; Bind value (':', $ _POST ['description']); $ query-> executed (); $ line = $ query- & gt; bring (); // More things}
All help was appreciated!
Edit: Do not take proper care, error:
can not do Other unrestricted queries are active, while executing queries. Consider using PDOStatement :: fetchAll (). Alternatively, if your code is only running against mysql, then you can query the PDO :: MYSQL_ATTR_USE_BUFFERED_QUERY query by setting the The buffering can be enabled
A very uncomfortable error that goes away when I comment on the previous query. This is strange because the preceding query is on many pages and without problem. In addition, it only gives one result, so I'm not sure what this error really is. Here's the preceding query:
$ sql = 'Choose bgcolor from the setting' id = userid on the Inner Inner User Username = Username '; $ Query = $ link & gt; Ready ($ SQL); $ Query-> Bind value (': user', $ _SESSION ['username']); $ Query-> Executed (); $ Line = $ query- & gt; Bring (); $ Rgb = str_split ($ line ['bgcolor'], 3);
It runs on every page (because I'm new and inefficient and does not save session and cookies) and works fine before this. It only gives a result.
I did not have the $ query-> Closed cursor (I);
, As mentioned in some linked SE queries, for each selected query executed on this page to reach the workplace position
It is less than ideal and I want to be a real cause and solution of this problem Unfortunately I do not have Server Config Access to check other solutions.
This has worked, but some comments show that it does not work for them:
$ Link-> Set Attribution (PDO: MYSQL_ATTR_USE_BUFFERED_QUERY, true);
Comments
Post a Comment