Possible Duplicate:
Best way to stop SQL Injection in PHP
I'd like a simple way to validate against the possibility of SQL injection when using a MySQL database through PHP (i.e. to ensure a user-provided name in a $_POST contains no sql sub-queries).
What I'm looking for doesn't necessarily have to be industrial strength or unbreakable (though it would be nice admittedly) - its more or less for a personal project to teach myself things.
So, is there a standard, somewhat simple way of doing this in PHP? (I'm assuming there has to be). I know I could run a pile of hand-crafted regular expressions to check for SQL in my PHP-provided strings, but I can't believe that's the best way!