updated the way mysql string is being generated