In PHP Mapscript, the queryby... methods on the Layer class (http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/classes/layerobj ) appear to do what you want--find the shape that matches the coordinates. From there you can query the shape's attributes, get its FIPS code, and hit your database. Hal