fix potential sql injection

Improve the handling of quotes in the query string for Help/ id and psychic q parameters.