From: Roland Häder Date: Mon, 29 Jul 2013 22:04:18 +0000 (+0000) Subject: Better use isValidSqlLink() (driver-dependent) than is_resource() which worked only... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5855377579850556ccfb7d667d5b5fdcc406b7dd;p=mailer.git Better use isValidSqlLink() (driver-dependent) than is_resource() which worked only with now deprecated MySQL extension --- diff --git a/inc/ajax/ajax_installer.php b/inc/ajax/ajax_installer.php index 0031a183cd..5e6bf0d664 100644 --- a/inc/ajax/ajax_installer.php +++ b/inc/ajax/ajax_installer.php @@ -62,7 +62,7 @@ function establishAjaxInstallerDatabaseLink () { $linkResource = sqlConnectToDatabase(getSession('mysql_host'), getSession('mysql_login'), getSession('mysql_password1'), __FUNCTION__, __LINE__); // Is this a link resource? - if (!is_resource($linkResource)) { + if (!isValidSqlLink($linkResource)) { // Is not a resource reportBug(__FUNCTION__, __LINE__, 'linkResource[]=' . gettype($linkResource) . ', expected: link resource'); } elseif (!isSqlLinkUp()) { diff --git a/inc/sql-functions.php b/inc/sql-functions.php index 9e82b02daf..cc16793be7 100644 --- a/inc/sql-functions.php +++ b/inc/sql-functions.php @@ -585,7 +585,7 @@ function ifSqlTableExists ($tableName) { array($tableName), __FUNCTION__, __LINE__); // Is a link there? - if (!is_resource($result)) { + if (!isValidSqlLink($result)) { // Is installation phase? if (isInstaller()) { // Then silently abort here @@ -630,7 +630,7 @@ function ifSqlTableColumnExists ($tableName, $columnName, $forceFound = FALSE) { ), __FUNCTION__, __LINE__); // Is a link there? - if (!is_resource($result)) { + if (!isValidSqlLink($result)) { // Is installation phase? if (isInstaller()) { // Then silently abort here @@ -672,7 +672,7 @@ function ifSqlTableIndexExist ($tableName, $keyName, $forceFound = FALSE) { $result = sqlQueryEscaped("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__); // Is a link there? - if (!is_resource($result)) { + if (!isValidSqlLink($result)) { // Is installation phase? if (isInstaller()) { // Then silently abort here