I'm learning PHP and have a basic question.
When I access a MySQL database like this:
$dsn = "mysql:host=localhost;dbname=myDB";
$db = new PDO($dsn, 'username', 'password');
$products = $db->query( 'SELECT * FROM products WHERE categoryID = 1 ORDER BY productID');
How do I get the total number of records returned from the query?