I have written code with the intention of getting an integer quantity but the result am getting is in an array format.How do I convert that from an array to an integer. Am getting the results from a MySQL database... Here is my code, Instead of it returning an array I need to get the array value that is at that key
function hcQuantiy($db, $isbn)
{
$query = "SELECT num_hardcover from inventory where isbn = :isbn";
$statement = $db->prepare($query);
$statement->bindValue(':isbn', $isbn);
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
$statement->closeCursor();
return $result;
}