I wonder whether someone may be able to help me please.
I’m using the query below to correctly retrieve Google marker data from a MySQL database.
SELECT l.locationid, f.locationid, l.locationname, l.osgb36lat, l.osgb36lon, count(f.locationid) as totalfinds
FROM detectinglocations as l
LEFT JOIN finds AS f ON l.locationid=f.locationid
GROUP BY l.locationid
I’m now trying to add to this by adding a where clause, to be more specific where userid='$userid'.
I’ve tried adding this extra clause in various positions within the query, and I’m sure that this is perhaps just a beginners mistake, but I just can’t get the query to work.
I just wondered whether someone could perhaps look at this and let me know where I’m going wrong.
Thanks and kind regards
Try adding the where clause right before GROUP BY.