Event detail - improved mysql handling