What a rubbish object PDO class is.
I have written classes before with properties and methods. But I have never seen an object destroyed by calling a method. A call to stmt->fetch() only works if you don’t make a call to the method stmt->rowcount()
So you have to re-establixh the stmt object again as
<?
$pdo = connectDB();
$Name = "Marvin";
$stmt = $pdo->query("SELECT * FROM PDO WHERE Name_F = '" . $Name . "'");
$count = $stmt->rowCount();
if($count ==1)
{
$stmt = $pdo->query("SELECT * FROM PDO WHERE Name_F = '" . $Name . "'");
$row = $stmt->fetch();
echo $row['Name_F'] . "<br>";
}
echo "Music count = " . $count; // Should be 1
?>