Commonly squash borers pierce the stem and lay their eggs in the stems causing them to wilt, and after a while the stem becomes mushy. This happens at ground level early in the season and can be discouraged by wrapping the young stems in aluminum foil to protect them from the adult borers. If you see wilting, slit open the stems, remove the larvae (white with black heads), then cover the damaged stem with good soil and keep watered.
New roots will develop from the buried stem. It also helps to keep the young plants covered with floating row cover (available at nurseries and garden centers), pegged down at the edges so that the flying adults cannot enter. When the flowers start to open (males first, then both sexes) you must remove the row cover to allow pollinators to enter. By that time the stems are usually hard enough that the insects cannot penetrate the stems to lay their eggs.