|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL Server - Php mssql connection - Intermittently Connects???
We have created some very simple php pages to see if the code can retrieve data from our SQL Server, and they do successfully query the database and return data, BUT, only about 2 out of 10 times on a browser refresh. The rest of the times we get a "Unable to connect to server: localhost,1433" error.
This, of course, has us very confused. I'd almost rather not be able to connect at all as it would make more sense. If you are able to provide any insight into what might be happening with our setup, it would be MUCH appreciated. We are running MSSQL 8.00.818, PHP Version 5.2.5, and IIS 6. Thanks in advance. |
|
#2
|
|||
|
|||
|
Wow...
mssql_pconnect vs. mssql_connect The "pconnect" works while just the "connect" doesn't. While I'd love to know the "why" of it, I am ecstatic for now that things seem to be working. |
|
#3
|
||||
|
||||
|
iirc pconnect tries to reuse the connection handles internally while connect creates a new one every time. I would assume your connect is running out of available connections and that is why you can only connect so many times.
__________________
life is a game.... Have fun ----------------------------- http://www.phpwomen.org strength in unity PHPCommunity IRC #phpc on freenode |
|
#4
|
|||
|
|||
|
Even mssql_pconnect seems flaky
Hi there -
Thanks for the response. Even though I have gotten mssql_pconnect to "work" for me, it still appears to provide a less than stable connection. There are significant numbers of times where, on a refresh, the attempt at a connection will fail. This is, naturally, frustrating, and it may cause me to port to a mySQL database in hopes of better reliability. It just seems unthinkable that I could not reliably establish a connection to an MSSQL database. I know there's a lot of variables, and I've looked into and confirmed many of them, and yet I still have a flaky connection. |
|
#5
|
|||
|
|||
|
I'm having the same problem, although it seems to have cropped up recently. My database calls are abstracted with my own library, so I even added a "3 tries" algorithm to the connect function, but I still can't connect.
Any ideas? I've heard that PHP still utilizes an ancient DLL to access the SQL server, is this true? |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > SQL Server - Php mssql connection - Intermittently Connects??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|