Show ellipsis (…) only if the number of characters exceeds limit defined in substr

In the form you have posted this is more of PHP question – you could use strlen() functions to determine length of original title and apply ellipsis conditionally.

However in WP context you should consider using wp_trim_words() since trimming based on words looks tidier and it will take care of appending string of your choice whet cutting.

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