get_the_title outputs title until spacing; it does not get full length of title

Your title isn’t correctly encoded for use in a query variable. Try this:

echo ' <a href="http://www.testungsss.com/search?q=' . urlencode($titletest) . '">' . $titletest . '</a>';

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