// MERGE with trunk revision 7754

This commit is contained in:
rMalie
2011-07-27 12:48:42 +00:00
parent 21017fb5d8
commit 233c0076b7
182 changed files with 6179 additions and 1333 deletions
+11 -3
View File
@@ -137,11 +137,19 @@ class MySQLCore extends Db
}
/**
* @see DbCore::tryToConnect()
* tryToConnect return 0 if the connection succeed and the database can be selected.
* @since 1.4.4.0, the parameter $newDbLink (default true) has been added.
*
* @param string $server mysql server name
* @param string $user mysql user
* @param string $pwd mysql user password
* @param string $db mysql database name
* @param boolean $newDbLink if set to true, the function will not create a new link if one already exists.
* @return integer
*/
static public function tryToConnect($server, $user, $pwd, $db)
static public function tryToConnect($server, $user, $pwd, $db, $newDbLink = true)
{
if (!$link = @mysql_connect($server, $user, $pwd))
if (!$link = @mysql_connect($server, $user, $pwd, $newDbLink))
return 1;
if (!@mysql_select_db($db, $link))
return 2;