Hi,
I need to display all properties that exist within x milles of the entered postcode.
This is my query:
SELECT p.ID AS PropertyID, p.PriceSale, p.PriceRent, p.Status, p.Name AS PropertyName, p.Type, p.Image1, p.Image2, p.Image3, p.Image4, p.Image5, p.Image6, p.Description, p.NumBedrooms, p.Address1, p.Address2, p.TownCity, p.County, p.Postcode
FROM Properties AS p
WHERE p.Type = "Sale"
AND (
SQRT( POWER( (
x_cord -353800
), 2 ) + POWER( (
y_cord -429300
), 2 ) ) <5
)
AND p.NumBedrooms +0 >=2
AND p.PriceSale +0 >=2
ORDER BY p.PriceSale +0 ASC
LIMIT 0 , 30
It give me the same results even if I change the distance to whatever
SQRT( POWER( (
x_cord -353800
), 2 ) + POWER( (
y_cord -429300
), 2 ) ) < distance(miles)
can you help me with this
Thanks 😕