ms sql pconnect

admin

Administrator
Staff member
I've just tried a quick experiment an SQL 2000 database using the following methods:

- php's own mssql interfaces (mssql_*)
- odbc
- ado (via COM)

None of them seem to be able to make persisten connections.

The first method fails as described here: <!-- m --><a class="postlink" href="http://bugs.php.net/bug.php?id=12095">http://bugs.php.net/bug.php?id=12095</a><!-- m -->

The second method (ODBC), according the the sql profiler, leaves connections open but also on occasion opens up a new connection without closing the last one. After running a simple connect and query script over and over I ended up with 20 existing connections from PHP.

And I just can't get ADO to pconnect at all.

The problem with this is that I'm getting an added delay to the execution of my pages on a larger scale site. Sometimes around 20-30ms, sometimes up to 100 and 200 depending on the load (using php's native mssql functions).

Can anyone recommend a way to access MS SQL from PHP with successful pconnects? At the moment all I can do is per-script connects. Connect, login, do queries, disconnect. Not particularly efficient.

If the above isn't possible, can anyone recommend any win32 databases that will allow PHP to pconnect? postgresql? Just that I would like to ask first before trying myself, see if anyone else has succeeded where I've failed.

Platform:
Windows 2000 Advanced Server (heh, "advanced" :)
Apache 1.3.20 (or whatever the latest win32 apache binary is)
PHP 4.0.6 running as apache module
 
Back
Top