/** * Returns the error text from the last operation done on the database server. * @param resource $connection (optional) The database server connection, for detailed description see the method query(). * @return string Returns the error text from the last database operation, or '' (empty string) if no error occurred. */ public static function error($connection = null) { return self::use_default_connection($connection) ? mysqli::mysqli_error() : mysqli::mysqli_error($connection); }