Add category to my get_post query

Did you try

$query = 'posts_per_page=3&cat=3';

?

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