I would like to do something like this but it is not working, I mean no elements are returned i.e. empty query. How could i achieve that?
foreach ($ghasharr as $key=>$val)
{
$stmt = $db->prepare("SELECT COUNT(id) as ccount FROM pics WHERE gallery=:ghash");
$stmt->bindValue(":ghash", $key);
$results = $stmt->execute();
$countarr[$results['ccount']] = $results['ccount'];
}