What's the difference between these two count methods please?
Which one is the best, quickest, ... ?
Thanks.
Method 1:
$query = $pdo->prepare('SELECT COUNT(*) AS count FROM table');
$query->execute();
$fetch = $query->fetch();
$count = $fetch['count'];
Method 2:
$query = $pdo->prepare('SELECT * AS count FROM table');
$query->execute();
$count = $query->rowCount();