If you want to pass a string to a database you can't use single quotes. If you want single quotes in the string you must double them up. That's why you get the error.