Show the current post’s category, without displaying parent category

Check if each category has a parent:

foreach( ( get_the_category() ) as $category ) { 
    if( $category->category_parent != 0 ):
        echo $category->cat_name . ' is a child category ';
    else:
        echo $category->cat_name . ' is a parent category ';
    endif;
}

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