Currents running through wires of different shapes produce different magnetic fields. Consider a circular loop with a current traveling in a counter-clockwise direction around it (as viewed from the top). By pointing your thumb in the direction of the current, you should be able to tell that the magnetic field comes up through the loop, and then wraps around on the outside, going back down.

  For N loops put together to form a flat coil, the field is just multiplied by N the number of loops