cjbeck71081 Posted August 11, 2007 Share Posted August 11, 2007 I was interested in trying to calculate against an SQL Table and return values that matched within the calculation. What i am trying to put together is a Zip Code Locator. I have a table "AREA" of Lat, Long and Zip Code numbers for the area im interested in. I also have a table "LOCATIONS" of Lat, Long and Zip code numbers for 25 different locations with data about Store Name, Address, etc. What i would like to do is have a user input thier Zip code and that would launch one query, which would pull down the Lat & Long from the table "AREA". I would like to then Query the database "LOCATIONS" and calculate the distance between them using a formula. So it would do this. User submit--->$_POST['zip'];---->Query and bring down LAT, LON from "AREA" table--->Query the LOCATIONS table, bring down all values---->calculate LAT, LON, from AREA table minus LAT, LON from the LOCATIONS table and populate to Variables the values that were LESS THAN 5 or something. I hope this made sense. Sorry it was written quickly. Even a tutorial that is similar, might allow me to utilize some of the same ideas to make this happen. Thanks Chris Quote Link to comment https://forums.phpfreaks.com/topic/64409-calculating-against-sql-database-returing-values/ Share on other sites More sharing options...
hitman6003 Posted August 11, 2007 Share Posted August 11, 2007 http://www.stroz.us/php/index.php?option=com_smf&Itemid=40&topic=98.0 Quote Link to comment https://forums.phpfreaks.com/topic/64409-calculating-against-sql-database-returing-values/#findComment-321131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.