ejaboneta Posted October 20, 2010 Share Posted October 20, 2010 We have an on site mssql database that I'm connecting to from a virtual dedicated server with php. Half of the time it works and then suddenly it stops working. I get the 'Could not connect to server.' from my code below. After an hour or two it decides to work again without any explaination. Any ideas? $mhost = '55.55.555.55:1397'; $muser = 'username'; $mpass = 'password'; $link = mssql_connect($mhost, $muser, $mpass); if (!$link) { die('Could not connect to server.'); } $db = mssql_select_db('DatabaseName') or die('Could not select db.'); Quote Link to comment https://forums.phpfreaks.com/topic/216314-cant-connect-through-php-half-of-the-time/ Share on other sites More sharing options...
Brian Swan Posted October 20, 2010 Share Posted October 20, 2010 You should be able to get more detailed error information...can you get the error code and the more detailed error message? That will hep in figuring out what is going on. And, are you running PHP on a Windows machine? Thanks. -Brian Quote Link to comment https://forums.phpfreaks.com/topic/216314-cant-connect-through-php-half-of-the-time/#findComment-1124213 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.