Cannot call function leftJoin on a SelectQuery object? $query = db_select('drupal5users', 'udf');
$query-&gt;leftJoin('drupal5users_roles', 'ur');
$query-&gt;fields('udf', array('uid','name','pass','mail','created','access','login','status','language','init'));
$query-&gt;fields('ur', array('rid'));


The above gives me the following error:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 ') subquery' at line 1.

If I comment out $query->leftJoin and the second $query->fields line, it works, so the problem lies with leftJoin. What am I doing wrong here?
$query-&gt;leftJoin('drupal5users_roles', 'ur', 'udf.uid = ur.uid');