error: function returns address of local variable

I’m beginner with C and I am learning on my own. I am creating the following function: I am basically trying to return an appended string, but I get the following error: “error: function returns address of local variable”, any suggestions, how to fix this?

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