The following should work (I suppose) but is resulting in empty result
$result2 = $db->query("
SELECT productId
FROM xxxxx
WHERE productId = '6'
AND customer_id = '$id'
");
$check=$db->num_rows($result2);
if($check >0 )
{
$check1=$result2['COUNT(productId)'];
echo"check1: $check1<P>";
}
$result2 = $db->query("
SELECT productId
FROM xxxxx
WHERE productId = '6'
AND customer_id = '$id'
");
$check=$db->num_rows($result2);
if($check >0 )
{
$check1=$result2['COUNT(productId)'];
echo"check1: $check1<P>";
}