src/lastfmapi/Lib/Cache.php
private function check_table_exists()
    {
        if ($this->type == 'sqlite') {
            $query = "SELECT count(*) FROM sqlite_master WHERE name='cache'";
            $result = $this->db->query($query);
            $numbers = $result->fetchAll();
            if ($numbers[0]['count(*)'] > 0) {
                // Ok
            } else {
                $this->create_table();
            }
        } else {
            $query = "show tables like 'cache'";
            $result = $this->db->query($query);
            if ($result->size() > 0) {
                // Ok
            } else {
                $this->create_table();
            }
        }
    }
private function check_table_exists()
    {
        if ($this->type == 'sqlite') {
            $query = "SELECT count(*) FROM sqlite_master WHERE name='cache'";
            $result = $this->db->query($query);
            $numbers = $result->fetchAll();
            if ($numbers[0]['count(*)'] > 0) {
                // Ok
            } else {
                $this->create_table();
            }
        } else {
            $query = "show tables like 'cache'";
            $result = $this->db->query($query);
            if ($result->size() > 0) {
                // Ok
            } else {
                $this->create_table();
            }
        }
    }
private function check_table_exists ( ) { if ( $ this -> type == 'sqlite' ) { $ query = "SELECT count(*) FROM sqlite_master WHERE name='cache'" ; $ result = $ this -> db -> query ( $ query ) ; $ numbers = $ result -> fetchAll ( ) ; if ( $ numbers [ 0 ] [ 'count(*)' ] > 0 ) { // Ok
 } else { $ this -> create_table ( ) ; } } else { $ query = "show tables like 'cache'" ; $ result = $ this -> db -> query ( $ query ) ; if ( $ result -> size ( ) > 0 ) { // Ok
 } else { $ this -> create_table ( ) ; } } }
Internal method to check if the table exists
@access private
@return void
Internal method to check if the table exists