I am fighting with a syntax error and I can't really find the problem.
this is my query
SELECT * FROM wp_postmeta PM1
WHERE PM1.meta_key = '_pronamic_google_maps_latitude'
AND PM1.post_id = '$id'
JOIN wp_postmenta PM2
WHERE PM2.post_id = PM1.post_id
AND PM2.meta_key = '_pronamic_google_maps_longitude'
and getting this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JOIN wp_postmeta PM2' at line 3
could please someone can give me a hint what i'm missing?
AND PM1.post_id = '$id'
unless$id
is the actual value in your table. Have you triedAND PM1.post_id = ". $id
?