note 74699 added to ref.mssql
| From: | vbchris at gmail dot com | Date: | Tue, 24 Apr 2007 08:22:26 +0000 |
| Subject: | note 74699 added to ref.mssql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125822@lists.php.net to get a copy of this message | ||
My previous post although seemed to solve the problem of the connection randomly refusing to
connect, it didn't. This however did. I created a loop to create a few connections and noticed
it was always the first connection that failed. So I wrote this to keep trying to connect until it
eventually does.
<?php
while(!$connection){
@$connection =
mssql_connect($cfg['server'],$cfg['username'],$cfg['password']);
}
$db = mssql_select_db($cfg['database'],$connection) or die("Error selecting the
database");
?>
----
Server IP: 87.124.64.96
Probable Submitter: 194.46.7.46
----
Manual Page -- http://www.php.net/manual/en/ref.mssql.php
Edit -- https://master.php.net/note/edit/74699
Del: integrated -- https://master.php.net/note/delete/74699/integrated
Del: useless -- https://master.php.net/note/delete/74699/useless
Del: bad code -- https://master.php.net/note/delete/74699/bad+code
Del: spam -- https://master.php.net/note/delete/74699/spam
Del: non-english -- https://master.php.net/note/delete/74699/non-english
Del: in docs -- https://master.php.net/note/delete/74699/in+docs
Del: other reasons-- https://master.php.net/note/delete/74699
Reject -- https://master.php.net/note/reject/74699
Search -- https://master.php.net/manage/user-notes.php