I'm trying to get some dataa from a table, and search for another field on other table by the id i got on my first query
$db = new PDO('mysql:host=localhost;dbname=xxxxx;charset=utf8', 'xxxxx', 'xxxx');
foreach($db->query('SELECT * FROM oc_store') as $row) {
echo $row['name'].' '.$row['url']. ' '. $row['store_id'];
}
This works fine. But i have to
select value from oc_setting where store_id == oc_store.store_id and key == config_logo
and echo all togheter, like:
echo $row['name'].' '.$row['url']. ' '. $row['store_id']. ' ' .$row['value'];
I tried nested foeach (silly me :P) and also with the LEFT JOIN, but i'm afraid i couldn't get it working, maybe i'm missing the right sintax for that.... Any helps? Thank you all