Check & remove special characters in a field?

You could use regex to only allow alphanumeric characters.

$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);

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