How to show only child categories using the_category();

<?php
foreach((get_the_category()) as $category) {
    if ($category->category_parent  == '7') {
        echo '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf(__( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> ';
    }
}
?>  

All you need to do is replace 7 with whatever category you want to include

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