Connection busy with results for another hstmt ERROR

I'm a newbie. I have written most of my queries in PHP. I created a connection object and then hit the sql server.

function navigation($sel_subject, $sel_page,$filter=false) {

    $subject_set = get_all_subjects();
    $page_set = get_pages_for_subject($subject["id"],$sec_wp,$filter);
}

function get_all_subjects() {
    global $connection;
    $query = "  SELECT * FROM subjects ORDER BY position ";
    return odbc_exec($connection,$query);
}

Now I am updating a few simple queries that just need to extract data from the database. I upgrade them to stored procedures.

function get_all_subjects() {    global $connection;
    $query = "  EXEC get_all_subjects ";  
 return odbc_exec($connection,$query); }

An error message appears. Connection busy with results for another hrmt ERROR

I am using sql server 2005 and with ODBC connectors.

. , - http://sourceitsoftware.blogspot.com/2008/06/connection-is-busy-with-results-for.html ... BDE MS SQL Server ODBC (?) SQL SQL Server ODBC.

, MARS ( ). , , , .

+3
4

MARS (Multiple Active Resultset), . , " SQL".

+4

odbc_free_result, odbc_exec?

+1

, .

SQL.

LIMIT * . SQL.

-, (..: Keyname/Index ..). - (, 50 000 ), InnoDB, . (temp) db-, db. , , , " ".

-, 1 , " ", , -, . ( , ) , .

cyberkiwi, ADOdb ftp , , ADOdb . , ADOdb, ADOdb, :

$Data = $connection->Execute("SELECT field1, field2, field2 FROM subjects ORDER BY position ASC LIMIT 0, 10");
if (is_object($Data)&&(!$Data->EOF))
{
    while (!$Data->EOF)
    {
        //
        // string, array, echo, whatever here
        //
    $Data->MoveNext();
    }
}
unset($Data);

In the end, although these types of errors are the result of a poorly written SQL statement that causes several connections to stop (in this case you need to increase your "maximum concurrent connections") or simply not enough internal memory or php dedicated memory (in this case, ask to increase your "memory_limit ").

0
source

Source: https://habr.com/ru/post/1786401/


All Articles