PHP versions prior to 6 have a basic guard against injection attacks that attempts to escape "dangerous characters". This guard is called "magic quotes". It's an optional setting, so your hosting provider may have it turned off. Starting with version 6, this protection is removed, as it's caused a lot of problems for coders. So you should be rethinking your input validation to ensure compatibility and security when you upgrade your PHP platform.
http://www.tizag.com/phpT/php-magic-quotes.php
Here's how SQL injection attacks work:
http://www.unixwiz.net/techtips/sql-injection.html