[B]$v = $db->prepare("SELECT * FROM users WHERE ref=?");[/B] $v->execute(array($yourref )); $toplam = $v->rowCount()