I have a question how to do this but completely in mySQL. In PHP I would do something like this.
foreach($stores as $store)
//and query the different table and let it join in an array
$query = 'SELECT * FROM different_table WHERE postcode='.$store->postcode;
I tried it already in SQL.
SELECT c.id as place_id, c.title, c.city, d.postcode_from
FROM data_different d
INNER JOIN (SELECT id,title,city, postcode FROM data_places WHERE uid=3 AND hidden=0 AND deleted=0) c
ON c.postcode = d.postcode_from
ORDER BY d.postcode_from ASC
But it doesn't work completely. It does join the table but only partially.
Could anybody fix this?