0

Hai everybody,
i have problem in following query.

this query working fine in seperated,

i add two array value.

totalcount display first value.
what is the problem in my query.

anybody plx help me

$sql="SELECT count( DISTINCT friendoffriends_id ) AS count
                                from mycommunity
                                    WHERE personal_id =:personal_id
                                    and blocked=0 ";


        $query = $db->prepare($sql); 
        $query->execute(array('personal_id' => $this->personal->getId()));
        $this->communityunblock = $query->fetchAll();


        $this->totalunblockcount =$this->communityunblock + $this->friendsunblock;
        var_dump($this->totalunblockcount);

`

3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by diafol
0

you applying count and distinct function together i don't think it will work for you
distinct function gives you one record for repeated records
and count function counts all the records in from a table.
you have to change your query otherwise you get error

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.