why do ionic compounds conduct electricity when in molten state or solution but not when solid?

GCSE