Monday, December 16, 2013

Join query drupal

$query = db_select('leveltracking', 'n')->fields('n');
$query->join('resorts', 'r', 'n.resort_id = r.resort_id');
$query->join('members', 'm', 'n.membership_id  = m.membership_id');
$result = $query->execute();
while($record = $result->fetchAssoc()) 
{
   $record['fromdate'];
}

No comments:

Post a Comment