Change mysql cursor. Try to improve parsing