It depends strictly on the state. In Kalifornia it is not illegal to carry in a school as long as you have a carry permit.
WOW.. completely false
Penal Code 626.9 PC - its California Gun Free School Zone Act which applies to all schools in California, that's 1000 feet from the school with the exception of residency, passing by, law enforcement agency, or with a written approval by the schools district superintendent.
Penal Code 12050 - does "NOT" exempt a CCW holder from prosecution if you carry a concealed weapon in a school zone, you can be charged with a felony if you carry within 1000 feet of a school, the 1000 feet is a bit extreme but can be fought in court tho unless you willingly knew that there's a school there and you were just hanging around.
Its an unwritten understanding tho that if you have a CCW, officers can let you off with the 1000 feet law - it mostly depends on the citing officer, he can pull out that surveyors wheel and start counting feet from your location - that would be if you got an officer having a bad day or he finds you disrespectful.
EDIT:
i just looked it up since its been a while since i know, its actually 1500 feet now.
Link Removed