Fatal error: Call to a member function fields() on a non-object
SelectQuery::join(), SelectQuery::leftJoin() etc. don't return the query (they return the alias to the created JOIN), so they can't be chained.

Just separate your code out like this:

$query = db_select('hd_lights', 'l')
  -&gt;fields('l')
  -&gt;fields('s', array('stamp', 'message'))
  -&gt;orderBy('`order`', 'ASC');

$query-&gt;leftJoin('hd_status', 's', 'l.id = s.id');

$result = $query-&gt;execute();