converting mysql data to json object