clean mysql query