The man is in a critical condition after collapsing inside the Warehouse nightclub in Doncaster, police said.
Tablets, thought be a form of ecstasy, were found in his possession and witnesses said he took something.
A 32-year-old man was also taken to hospital but discharged after it was reported he took similar tablets.
Both men had been at the nightclub.
South Yorkshire Police warned anyone who bought tablets in Doncaster on Friday they may be dangerous.
The second man had also been in the Warehouse.
Det Sgt Andy Knowles said: "We believe these tablets may be some form of ecstasy, but this has not yet been confirmed.
"They may well be home made and could be extremely harmful."
A warning has been issued over a batch of potentially dangerous pills after a 29-year-old clubber suffered a heart attack.