You can download zip code and corresponding lat and long values for different countries from here: (this is open source data and free of charge)
http://download.geonames.org/export/dump/
You can then import the data into your database and query it.
Hope this helps.