Excellent, thank you very much. I've just been reading about 'SQL injection' and realised I would have to do something about it before launching my first website.
I've already included a certain amount of validation on the form - it runs htmlspecialchars in all entries, it checks the e-mail address to see if it is correctly formed (but not if it actually exists, which would be beyond my skills, I believe) and it checks to see if the fields are empty (name, e-mail, location [drop-down list], comment). Other than that, users can enter any old nonsense into the form. As long as I can prevent dangerous code from getting in, I'm happy to just delete garbage on a regular basis.
Norman