replacing proceduaral style to OO using mysqli