Category slug $_SERVER[‘REQUEST_URI’];

your syntax is wrong change the single quotation mark to a double quotation mark and remove the semicolom
on this line:

if (($uri == '/category/$yourcat->slug;') { 

it should become:

if (($uri == "/category/$yourcat->slug") {

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