Hello,
I’m having a problem with my sql, mysql keeps throwing errors at me:
[CODE]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:wampwwwprojectmarkerdata2.php on line 45
Line 45 refers to the query below:
query:
[code=php]
$query = “SELECT postcode1, postcode2, postcode, name, address1, address2, address3, address4, tel, email,
website, lat, long, type, (SQRT(POW((b.x – a.x), 2) + POW((b.y – a.y), 2))/1000) * 0.621 AS distance
FROM postcodes a, postcodes b, dealers
WHERE a.outcode LIKE ‘”.$postcode.”‘ AND b.outcode = dealers.postcode_1
HAVING (distance < ‘”.$area.”‘)
ORDER BY distance asc LIMIT 10″;
To be honest i don’t really understand the code section with all the brackets. is there an obvious flaw? if not i can also display my database tables.