What is code injection?

What is code injection? One of the websites is hacked by someone because when I open my website it is redirected to another website. I have removed the code injection script from the website and also deleted its database files from my server database, but I suppose it is a temporary solution, because again I receive spam links on my website.

How can i solve this problem. Please help me with permanent solutions for it.