Re: [PHP-DB] MSSQL Problems
Looks like this groups saves the day again. John Krewson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... mssql_pconnect cannot be closed as you mentioned: http://www.php.he.net/manual/en/function.mssql-pconnect.php I am using this as well, calling MSSQL on a Windows box from PHP/Apache on Linux, and I am also getting some of the results you mentioned, although it behaves differently at different times so I'm sticking with it to tinker. My advice would be to simply drop using mssql_pconnect and use mssql_connect. You don't gain much in the way of speed by using mssql_pconnect and I have seen several people come away with varied results. Your sys admin (or you if you do double duty) should be able to see if this is actually the case through SQL Server Enterprise Manager. It should show the calling server, the PHP version, and that the connections are sleeping. Tim Evans wrote: I've written a script that works perfectly for almost ten times, and then stops being able to connect to the MSSQL server. I imagine this has something to do with me not properly closing my connection, and the server having a maximum # of connections. I'm calling both mssql_free_result() and mssql_close() after every query. I'm using mssql_pconnect. I would include sample code, but it does this whether I use code ripped right from examples and docs or I write it myself. It doesn't seem to matter what database, or the type or amount of information I'm requesting. Thanks for any help I get on this problem, it's driving me nuts. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MSSQL Problems
mssql_close() doesnt do anything when you use mssql_pconnect as this is a persistant connection. If you want to close the connection after you've finnished with it you should use mssql_connect() instead. Hope this helps -Original Message- From: Tim Evans [mailto:[EMAIL PROTECTED]] Sent: 05 December 2002 13:33 To: [EMAIL PROTECTED] Subject: [PHP-DB] MSSQL Problems I've written a script that works perfectly for almost ten times, and then stops being able to connect to the MSSQL server. I imagine this has something to do with me not properly closing my connection, and the server having a maximum # of connections. I'm calling both mssql_free_result() and mssql_close() after every query. I'm using mssql_pconnect. I would include sample code, but it does this whether I use code ripped right from examples and docs or I write it myself. It doesn't seem to matter what database, or the type or amount of information I'm requesting. Thanks for any help I get on this problem, it's driving me nuts. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MSSQL Problems
mssql_pconnect cannot be closed as you mentioned: http://www.php.he.net/manual/en/function.mssql-pconnect.php I am using this as well, calling MSSQL on a Windows box from PHP/Apache on Linux, and I am also getting some of the results you mentioned, although it behaves differently at different times so I'm sticking with it to tinker. My advice would be to simply drop using mssql_pconnect and use mssql_connect. You don't gain much in the way of speed by using mssql_pconnect and I have seen several people come away with varied results. Your sys admin (or you if you do double duty) should be able to see if this is actually the case through SQL Server Enterprise Manager. It should show the calling server, the PHP version, and that the connections are sleeping. Tim Evans wrote: I've written a script that works perfectly for almost ten times, and then stops being able to connect to the MSSQL server. I imagine this has something to do with me not properly closing my connection, and the server having a maximum # of connections. I'm calling both mssql_free_result() and mssql_close() after every query. I'm using mssql_pconnect. I would include sample code, but it does this whether I use code ripped right from examples and docs or I write it myself. It doesn't seem to matter what database, or the type or amount of information I'm requesting. Thanks for any help I get on this problem, it's driving me nuts. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MSSQL Problems
Take a look at the documentation at http://www.php.net/manual/en/function.mssql-close.php whhere it says mssql_close() will not close persistent links generated by mssql_pconnect(). connections created by mssql_pconnect() will only be closed when the PHP process terminates. - Frank I've written a script that works perfectly for almost ten times, and then stops being able to connect to the MSSQL server. I imagine this has something to do with me not properly closing my connection, and the server having a maximum # of connections. I'm calling both mssql_free_result() and mssql_close() after every query. I'm using mssql_pconnect. I would include sample code, but it does this whether I use code ripped right from examples and docs or I write it myself. It doesn't seem to matter what database, or the type or amount of information I'm requesting. Thanks for any help I get on this problem, it's driving me nuts. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php