Example #1
0
     * @return void
     * @static
     */
    public static function AffectedRows()
    {
        if (self::$lastQuery) {
            return self::$lastQuery->rowCount();
        } else {
            return false;
        }
    }
    /**
     * Disconnect from the current MySQL server.  Function is automatically called at the end of page execution.
     *
     * @return boolean True on success or False on failure
     * @static
     */
    public static function Disconnect()
    {
        self::$pdo = null;
    }
}
//If ENABLE_DB_QUERY_DUMP is set, setup a callback on the Database object to send all queries performed to a log file in /cache.
//This function requires /cache be writable.
if (defined('ENABLE_DB_QUERY_DUMP') && ENABLE_DB_QUERY_DUMP == true) {
    function database_debug_query($query)
    {
        error_log(date('Ymd.His') . ' ' . $query, 3, Path::Root('/cache/database.log'));
    }
    Database::$queryCallback = 'database_debug_query';
}