I have a database that is like this :
CREATE TABLE `zip_code` (
`zip_code` int(10) unsigned NOT NULL default '0',
`lattitude` float NOT NULL default '0',
`longitude` float NOT NULL default '0',
`city` varchar(25) NOT NULL default '',
`state_prefix` char(2) NOT NULL default '',
PRIMARY KEY (`zip_code`)
) TYPE=MyISAM;
Then of course I have a user table table that has
id|user|pass|city|state|zipcode
How can I search the user table first to get the users zipcode and then with that info, search the zip_code table to get all zipcodes within proximity of 50 miles within that users zipcode.
Then take all of those zipcodes and query the users table and show all users that have those zipcodes.
Please someone help me, I have looked and searched all over for some good examples and nothing.
I need somone to help me out with a good example on starting this...