Not possible to update using join

The support for Joomla 2.5 ended on December 31, 2014. Possible bugs in Joomla 2.5 will not be patched anymore. This forum has been closed. Please update your website to Joomla 3.x

Moderators: ooffick, dam-man

Forum rules
Please use the official Bug Tracker to report a bug: http://issues.joomla.org
User avatar
VisiGod
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 171
Joined: Fri Sep 02, 2005 2:26 am
Location: Portugal
Contact:

Not possible to update using join

Postby VisiGod » Wed Dec 07, 2011 1:39 am

I'm trying to update a table using a mysql query that relies on join but using the standard $query->update and $query->join, Joomla just ignores my joins.

Example:

Code: Select all

...
$query->update('#__users AS u');
$query->join('LEFT', '`#__temp_users_check` AS fmt ON u.username = fmt.name');
$query->join('LEFT', '`#__tracker_users_level` AS ul ON ul.id = fmt.ugroup');
$query->set('u.id_level = fmt.ugroup');
$query->set('u.wait_time = ul.wait_time');
$query->where('u.id IN ( '.$uids.' )');
...


Expected result:

Code: Select all

UPDATE #__users AS u LEFT JOIN #__temp_users_check AS fmt ON u.username = fmt.name LEFT JOIN #__tracker_users_level AS ul ON ul.id = fmt.ugroup SET u.id_level = fmt.ugroup , u.wait_time = ul.wait_time WHERE u.id IN ( 3,4,6,8 )


Given result:

Code: Select all

UPDATE #__users AS u SET u.id_level = fmt.ugroup , u.wait_time = ul.wait_time WHERE u.id IN ( 3,4,6,8 )


Is this the expected behavior (the Given result), a bug, or my error?

Note: Just opened a tracker issue.

Return to “Joomla! 2.5 Bug Reporting”

Who is online

Users browsing this forum: No registered users and 5 guests