LEFT JOIN with db_select() I'm trying to do a left join but it isn't working. 

I have 2 tables: 

TABLE profile
- uid
- pid

TABLE field_data_field_naam
- entity_id
- field_naam_value


I want to select the field_naam_value where uid is equal to .. and pid equal to entity_id. My normal query looks like this:

SELECT fdfm.field_naam_value, pf.uid
FROM field_data_field_naam fdfm
LEFT JOIN profile pf
ON fdfm.entity_id=pf.pid
WHERE pf.uid = 4


When I execute this on my database it works. Then I have this:

$naam = db_select('field_data_field_naam', 'fdfm')
     -&gt;fields('fdfm', array('field_naam_value'));
$naam-&gt;leftJoin('profile', 'pf', 'fdfm.entity_id = pf.pid');
$naam-&gt;condition('uid', 4)
     -&gt;execute();


And when I do the following:

foreach ($naam as $record) {
    die;
}


nothing happens... (he doesn't kill the app). Also tried to add -&gt;fetchAll() but no success.
Use the below code for fetching values. It will give you field_naam_value field data.

$naam = db_select('profile', 'pf');
$naam-&gt;join('field_data_field_naam', 'fd', 'pf.pid = fd.entity_id');
$all_names = $naam-&gt;fields('fd', ['field_naam_value'])
  -&gt;condition('pf.uid', 4, '=')
  -&gt;execute()
  -&gt;fetchAll();
foreach ($all_names as $record) {
  die;
}