Hi,
This query works but I need to modify it:
$query_userCoords = "SELECT COUNT(dest.outcode) as density, dest.outcode,
dest.x, dest.y FROM hwz_users AS source, hwz_postcodes AS dest WHERE
source.outcode = dest.outcode GROUP BY dest.outcode ASC";
- I have a table called personal_details instead of hwz_users
- The field in personal_details is called postcode instead of outcode
- Postcode contains the full postocde instead of just the outcode
E.g. PA28 6ST instead of PA28
So I need to say something like 'where the 'outcode' in 'hwz_postcodes' is in the string in 'postocde' in 'personal_details' but not an exact match'.
I thought it might be something like this but this does not work:
$query_userCoords = "SELECT COUNT(dest.outcode) as density, dest.outcode,
dest.x, dest.y FROM personal_details AS source, hwz_postcodes AS dest WHERE
dest.outcode LIKE 'source.postcode%' GROUP BY dest.outcode ASC";
Thanks