The provisions of sections to shall not apply to the use or sale of such substances, as defined in sections and , when such use or sale is administered or prescribed for medical or dental purposes, nor shall the provisions of sections to apply to the use or sale of alcoholic liquors as defined by section .