get only the item you click on

It’s called “event bubbling” or “event propagation” and the solution is to get the event object and use the JS stopPropagation method. Try this:

jQuery('.menu-item').click(function(event){
    var class_id = jQuery(this).attr('id');
    event.stopPropagation();
    alert(class_id);
});

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)