Here are a few possibilities to get the conversation started:
Prepared statements are the best answer. You have testing because you can make mistakes!
See this question.