Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try calling $result->close() before you call the second query, in order to release the connection. Your PHP script hasn't finished executing yet, and your previous result is holding that connection open. In general, it is good practice to explicitly clean up these kinds of resources rather than leaving it to the runtime.</p> <p><strong>EDIT:</strong> I believe @eis is correct that since this is the older (and deprecated, incidentally) mysql_ api, that the proper call would actually be mysql_free_result($result).</p> <p><strong>ANOTHER EDIT:</strong> I put this comment under @eis's answer, but I figure it bears bolder type, because @eis's answer was absolutely right and should not have been down-voted:</p> <p>Just to elaborate redundantly on the whole buffered vs. unbuffered thing; the <em>concept</em> is that a <strong>buffered</strong> query will read all of the results back from the database into a buffer, then release the connection automatically (this will happen synchronously, so that the connection is free for another call immediately after the buffered call returns). An <strong>unbuffered</strong> query will essentially open the connection and hand back a reference to a database server cursor, from which you will then need to fetch records. As long as there is something left to fetch, the cursor is still open, and you won't be using the underlying connection for <em>anything</em> else. Or you can call mysql_free_result() and free the connection "early" (without reading all of the rows from the cursor first).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload