query($query) as $row) { echo $row[0] . ' ' . substr($row[1], 0, 75) . "\n"; } $dbh = null; //This is how you close a PDO connection