Try to convert mysql to cpp