table($table)->countAllResults(); echo "$table count: $count\n"; if ($count > 0) { $row = $db->table($table)->get(1)->getRow(); echo "$table first row ID: " . (isset($row->{$table.'ID'}) ? $row->{$table.'ID'} : 'unknown') . "\n"; } } catch (\Exception $e) { echo "$table error: " . $e->getMessage() . "\n"; } }