Select Count Distinct

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

    ),



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

    ),

 );

may help you

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',

			),


		),

	),