MySQL does not seem to return anything in rowCount for a select statement, but you can easily and efficiently get the row count as follows:
class db extends PDO {
public function last_row_count() {
return $this->query("SELECT FOUND_ROWS()")->fetchColumn();
}
}
$myDb = new db('mysql:host=myhost;dbname=mydb', 'login', 'password' );
Then, after running your query:
if ( $myDb->last_row_count() == 0 ) {
echo "Do something!";
}