PHP echoes value without the use of echo

Instead of doing: print $term->name; you need to return $term->name; so you can then use it for queries you could run on it.

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