You do not say jQuery, but it will be easier than starting from scratch. jQuery for this:
http://www.outsharked.com/imagemapster/
The problem with access to the database is a little red herring. There is no reason why the server cannot transmit the data needed as part of the markup when loading the page, for example.
<script type="application/json" id="map-data">
[1,2,10,33]
</script>
.. - // . script - div, . JSON, . ImageMapster, . , , - , .
ImageMapster:
http://jsfiddle.net/jamietre/hD6bM/