It all comes down to removing escaping values. For more information go to wiki: http://en.wikipedia.org/wiki/SQL_injection
Just note that GET and POST things are BAD. Mainly because they can show what they are doing in the URL part of your browser and can be edited easy. Validate EVERYTHING and make sure it does not show the database error or SQL error to the viewer when it does not match the validation. And when possible, avoid input fields. Don't put unneeded ones in there. That is all I got.