dump sql result from mysql as json.