SimpleHistory::does_database_have_data PHP Method

does_database_have_data() public method

Check if the database has data/rows
Since: 2.1.6
public does_database_have_data ( ) : boolean
return boolean True if database is not empty, false if database is empty = contains no data
    function does_database_have_data()
    {
        global $wpdb;
        $tableprefix = $wpdb->prefix;
        $simple_history_table = SimpleHistory::DBTABLE;
        $simple_history_context_table = SimpleHistory::DBTABLE_CONTEXTS;
        $sql_data_exists = "SELECT id AS id_exists FROM {$tableprefix}{$simple_history_table} LIMIT 1";
        $data_exists = (bool) $wpdb->get_var($sql_data_exists, 0);
        return $data_exists;
    }
SimpleHistory