Display only subcategories of a category and not sub-subcategories

I would do something like this:

$categories = get_categories($args);
foreach ($categories as $category){
    if ($category->parent != $get_id_parent_cat->term_id){
        //Do stuff with the category
    }
}

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