After ajax image is outside the “ tag

Try this, with tags on .= '<a href=""https://wordpress.stackexchange.com/questions/227522/.get_permalink($id).""><img src="'.$image['url'].'" /></a>';

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