A customer who spilled Class C tablets in a Coleraine chip shop "fell asleep" on the floor as he tried to pick them up, the town's magistrates court has heard.
Steven McCloskey (29), of Rosemary Place in Coleraine, admitted unlawful possession of Diazepam on February 5 this year.
Police arrived and found the defendant heavily under the influence, the court heard.
There were 22 tablets and some fragments of Diazepam at the scene. The defendant told police he bought them from "someone down the street".
Defence solicitor Garrett Greene said McCloskey had "long-standing difficulties with drugs".
District Judge Peter King said the defendant had matters at other courts and said "it is quite clear you are labouring under a number of other difficulties".
McCloskey was given a one month jail sentence, suspended for 18 months, for possessing Class C drugs.