|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-30 20:22 UTC] fmk@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 18:00:01 2025 UTC |
Description: ------------ When executing multiple queries from a single mssql_query call, the connection is lost and subsequent connections cannot be created. There are similar problems documented for PHP4, but it seems that (a) this is not documented for PHP5; and (b) the inability to create subsequent connections is not documented. In particular, it seems the mssql_select_db is what is failing in the second connection. Reproduce code: --------------- $conn = mssql_connect('host', 'user', 'pass'); mssql_select_db("db", $conn); mssql_query("QUERY 1", $conn); mssql_query("QUERY 2; QUERY 3; QUERY 4;", $conn); // this will fail: mssql_query("QUERY 5", $conn); // this is ok mssql_close($conn); // everything below will fail too: $conn2 = mssql_connect('host', 'user', 'pass'); mssql_select_db("db", $conn2); mssql_query("QUERY 6", $conn2); Expected result: ---------------- The queries should execute with no problems. Actual result: -------------- Everything after the multiple query mssql_query call ("QUERY 2; QUERY 3; QUERY 4;" will fail. New connections fail when trying to select a database ("mssql_select_db() [function.mssql-select-db]: Unable to select database:...") and the existing connection cannot be used anymore ("mssql_query() [function.mssql-query]: Query failed in...") .