I have discovered a major flaw in my website, when I do a search on a post/zipcode it only picks up the zipcodes that are in the property table. I have another table called zipcodes which contains all the zipcodes of the area.
What should happen is that a user should enter their own zipcode (this zipcode is already stored in zipcode table) and it can find properties around that the users zipcode.
At the moment you have to enter a zipcode that is in the property table and it finds the properties from there, which is wrong.
Its either SQL1 or SQL3 but I can't see where I should alter or add. I know I haven't entered zipcode table anywhere but not sure where to put it.
$sql_3 = "SELECT * FROM property p, cmstype t WHERE
SQRT( (69.1 * (".$userLat." - p.latitude)) * (69.1 * (".$userLat." - p.latitude))
+ (53.0 *(".$userLong." - p.longitude)) * (53.0 *(".$userLong." - p.longitude)))
I think userlat and userlong need to be the ones from Zipcode table but it doesn't return any results when I change SQL 1 to Zipcodes
No replies to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users