Add onClick event on form input with multiple checkbox

To add a javascript onclick event on a form input with multiple checkbox, use this alternative method:

$options = array(); 
foreach($roles as $value => $label) { 
  $options[] = array( 
    'name' => $label, 
    'value' => $value, 
    'onClick' => 'showDiv(this)' 
  ); 
} 
echo $form->input('Role', array('options' => $options, ...)); 

But why use inline javascript? You could do this with one line of mootools:

$('input[id^=ModelRole][type=checkbox]').addEvent('click', showDiv);
(replace 'Model' with the name of your model)

And I’m sure it’s just as easy (or easier) in jQuery or other frameworks.

Duplicates Records in Multiple Fields with MySql

Retrieving count of Duplicated Records

SELECT firstname, lastname, COUNT(*)
FROM staff
GROUP BY firstname, lastname
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC;

Retrieving The Individual Duplicated Records

SELECT stafftable.firstname, stafftable.lastname
FROM staff stafftable
INNER JOIN (
SELECT firstname, lastname, COUNT(*)
FROM staff
GROUP BY firstname, lastname
HAVING COUNT(*) > 1) temp
ON temp.firstname = stafftable.firstname
AND temp.lastname = stafftable.lastname
ORDER BY firstname, lastname