get last part of page url and add it as cat in wp_query

get last part of page url and add it as cat in wp_query

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