if (!($db=new SQLite3('../path/db.sqlite3', 0666))) { echo "

error

"; die(); } $query = $db->query("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"); $result = $query->fetchArray(SQLITE3_ASSOC); echo "

tables

"; print_r($result); echo "
"; foreach ($result as $key => $value) { if ($value == 'blocks') { $has_blocks = 1; } } $db->close();