我想做这样的事情,但它不起作用,我的意思是没有返回任何元素,即空查询。我怎么能做到这一点?
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'];
}