See also: Detect SQL injection
HTH,
In reply to Re: Wrong SQL Syntax? by planetscape in thread Wrong SQL Syntax? by Frederic_S