I am working on a project. I am using symfony2 with XAMPP with PHP version of 5.5.19. I have three tables that have relationship ..
Here are the tables :
table_name : transaction_tbl
- transaction_id
-filename
-filepath
-sender
-doctype_id
table_name : doctype_tbl
-doctype_id
- doctype
-name
-description
table_name : transaction_details
- details_id
-ref_numbers
-amount
-transaction_id
what I want to do is to join the three tables so I can get the doctype with its details. Meaning need to join also the transaction and the transaction details. I don't know how to do it. Can somebody help ?
UPDATE
I forgot to say that I am using doctrine query builder.
$qb->select('DISTINCT m')
->from('MessageBundle:AssignmentUser', 'au')
->innerJoin('au.assignment', 'a', 'WITH', 'a.status = (:assigned)')
->innerJoin('au.user', 'u')
->innerJoin('a.message', 'm')
->where('u.id = (:user_id)')
->setParameter('assigned', 'assigned')
->setParameter('user_id', $yourSpecificUserId)
->orderBy("m.createdAt", "desc");
See Symfony2 / Doctrine multiple joins returns error for details.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments