Link to home
Start Free TrialLog in
Avatar of flynny
flynnyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PHP Doctrine Query Help

I want to convert the following sql statment to a doctrine query can an yone help?

i have the following mysql statement returning the code i need

SELECT p.user_id, p.main_photo, p.sex, v.visitor_id, v.date, u.username
FROM (
(
joomla_lovefactory_profiles p
LEFT JOIN joomla_lovefactory_profile_visitors v ON p.user_id = v.visitor_id
)
LEFT JOIN joomla_users u ON v.visitor_id = u.id
)
WHERE v.user_id =231

Open in new window


    $query = $dbo->getQuery(true)
        ->select('p.user_id, p.main_photo, p.sex','v.visitor_id v.date', 'u.username')
        ->from('#__lovefactory_profiles p, #__lovefactory_profile_visitors v, #__users u')
        ->leftJoin('p.user_id ON v.visitor_id')
	->leftJoin('v.visitor_id ON u.id')
        ->where('p.user_id = :user')
        ->setParameter('user', $user->id);

Open in new window


is returning no results?
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial