Page + Custom Post Type with same category

Fixed it as followed:

Within the loop I fetch the cat_ID:

 <?php
     foreach((get_the_category()) as $category) {
     $cat_id= $category->cat_ID;
   }
 ?>

Outside the loop I use the cat_ID:

'cat' => $cat_id,

I guess not the best solution but it works..

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