I am struggling with a syntax error and I cannot find the problem.
this is my request
$res2 = mysql_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'")
or die(mysql_error());
and get this error:
You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use next to "JOIN wp_postmeta PM2" on line 3
may like it, someone can give me a hint what am i missing?
source
share