]> git.mxchange.org Git - mailer.git/blobdiff - inc/db/lib-mysqli.php
introduced isSqlResult() which encapsulates checking MySQL/i results
[mailer.git] / inc / db / lib-mysqli.php
index e6c85030ddb401acdb7f3cd6f6b68ab462354168..b3559bf7e807a03548b5e511da1dd46517b9e87a 100644 (file)
@@ -11,7 +11,7 @@
  * Kurzbeschreibung  : Datenbankschicht fuer MySQL 3/4/5 Server (MySQLi)*
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -346,7 +346,7 @@ function setSqlError ($file, $line, $message) {
 
 // Checks whether given link is a valid SQL link
 function isValidSqlLink ($linkInstance) {
-       // Is it a resource?
+       // Is it an object?
        $isValid = (($linkInstance instanceof mysqli) || ($linkInstance instanceof mysqli_result));
 
        // Debug message
@@ -356,5 +356,17 @@ function isValidSqlLink ($linkInstance) {
        return $isValid;
 }
 
+// Checks whether given result is really a result
+function isSqlResult ($resultInstance) {
+       // Is it a resource?
+       $isValid = ($resultInstance instanceof mysqli_result);
+
+       // Debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'resultInstance[]=' . gettype($resultInstance). ',isValid=' . intval($isValid));
+
+       // Return result
+       return $isValid;
+}
+
 // [EOF]
 ?>