(Solved! = size tavsiye için teşekkür ederim çocuklar)
$contact = $db->select('*')
->from(array('c' => 'contact'), array('name', 'id'))
->join(array('d' => 'detail'), 'c.id = d.contact_id', array('d.type'))
->where('c.company_id = ?', $defaultNamespace->userdata['company_id'])
->where('c.effective < ?', date("Y-m-d H:i:s"))
->where('c.expire > ?', date("Y-m-d H:i:s"))
->order('c.effective DESC');
$stmt = $db->query($contact);
$contact = $stmt->fetchAll();
foreach($contact as &$point){
print_r($point);
}
Çıkışlar:
Array ([name] => John Doe [id] => 1 [type] => Skype) Array ([name] => John Doe [id] => 1 [type] => MSN)
Ben istiyorum:
Array ([name] => John Doe [id] => 1 [point] => array (Skype, MSN))