PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC] ); $rows = $pdo->query( "SELECT uid, title, slug, hidden, detail_page, teaser <> '' AS has_teaser, description <> '' AS has_description FROM tx_vitec_domain_model_solution WHERE deleted = 0 ORDER BY title" )->fetchAll(); echo "=== solutions (uid | title | slug | flags) ===\n"; foreach ($rows as $row) { printf("%3d | %-55s | %-45s | %s%s%s%s\n", $row['uid'], $row['title'], $row['slug'], $row['hidden'] ? 'HIDDEN ' : '', $row['detail_page'] ? ('detail_page=' . $row['detail_page'] . ' ') : '', $row['has_teaser'] ? 'teaser ' : '', $row['has_description'] ? 'desc' : '' ); } echo count($rows) . " solutions total\n";