gunnit
(Maric Gregor)
March 14, 2013, 10:53am
1
can someone tell me why is this not working, what i mean is that the select distinct is not working its not counting properly ;
$count_participants = BridgeMeeting::Model()->with('idUserRegistry')->count(array(
'condition' => 'id_meeting=:id_meeting',
'select' => 'id_user_registry',
'distinct' => true,
'params' => array(
"id_meeting" => $data->id_meeting
),
));
faridplus
(Faridplusplus)
March 14, 2013, 7:08pm
2
gunnit:
can someone tell me why is this not working, what i mean is that the select distinct is not working its not counting properly ;
$count_participants = BridgeMeeting::Model()->with('idUserRegistry')->count(array(
'condition' => 'id_meeting=:id_meeting',
'select' => 'id_user_registry',
'distinct' => true,
'params' => array(
"id_meeting" => $data->id_meeting
),
));
You forgot to prefix ‘id_meeting’ with a colon (in the ‘params’ array):
'params' => array(
":id_meeting" => $data->id_meeting
),
gunnit
(Maric Gregor)
March 15, 2013, 9:25am
3
faridplus:
You forgot to prefix ‘id_meeting’ with a colon (in the ‘params’ array):
'params' => array(
":id_meeting" => $data->id_meeting
),
i tried it and it dose not work , it still dose not do the count of distinct i also tried this but no positive results
$count_participants = BridgeMeeting::Model()->with('idUserRegistry')->count(
array(
'condition' => 'id_meeting=:id_meeting',
'select' => 'id_user_registry',
'distinct' => true,
),
array(
"id_meeting" => $data->id_meeting
),
);
gunnit:
i tried it and it dose not work , it still dose not do the count of distinct i also tried this but no positive results
$count_participants = BridgeMeeting::Model()->with('idUserRegistry')->count(
array(
'condition' => 'id_meeting=:id_meeting',
'select' => 'id_user_registry',
'distinct' => true,
),
array(
"id_meeting" => $data->id_meeting
),
);
[/code]
Can you paste us here exact sql statement that is being executed? You can enable mysql logs in main.php config file:
[code]
‘log’=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
array(
'class'=>'CWebLogRoute',
),
),
),