IAMPrometheus Posted June 7, 2011 Share Posted June 7, 2011 But I need it to go through different tables to find the user. for example. $this->_db->setQuery( "UPDATE #__jrleech SET `published` = '1' WHERE `id` = '". $row->id ."'" ); wont work, it needs to find it like this: __roxsuite_membership_history -> __users.username -> __jleech.user = 1 The user id's are different in those 2 tables jos_users and jos_roxsuite_membership_history id's match, but jos_jleech.user's id does not. Link to comment https://forums.phpfreaks.com/topic/238602-sql-php-help/ Share on other sites More sharing options...
Zurev Posted June 7, 2011 Share Posted June 7, 2011 But I need it to go through different tables to find the user. for example. $this->_db->setQuery( "UPDATE #__jrleech SET `published` = '1' WHERE `id` = '". $row->id ."'" ); wont work, it needs to find it like this: __roxsuite_membership_history -> __users.username -> __jleech.user = 1 The user id's are different in those 2 tables jos_users and jos_roxsuite_membership_history id's match, but jos_jleech.user's id does not. You need a join, whether it be using the join keyword, or using the traditional method: update #__jrleech, jos_users u, jos_roxsuite_membership_history m set `published` = '1' where `id` = '".$row->id."' and u.id = m.id; That definitely won't work, since it's hard to understand your actual question, but that should give you some guidance as to pulling values from multiple tables. Link to comment https://forums.phpfreaks.com/topic/238602-sql-php-help/#findComment-1226185 Share on other sites More sharing options...
IAMPrometheus Posted June 7, 2011 Author Share Posted June 7, 2011 http://pastebin.com/3YHzPtFi that code works for making published = 1 now I need to combine it with these 3 functions together: http://pastebin.com/fX6nXNkM So when I press approve it does all 3 at once. Thanks! Link to comment https://forums.phpfreaks.com/topic/238602-sql-php-help/#findComment-1226197 Share on other sites More sharing options...
IAMPrometheus Posted June 7, 2011 Author Share Posted June 7, 2011 this is what i got so far: http://pastebin.com/9dVbqpC5 then I have combined the button to use all 3 functions at once. IE: JToolBarHelper::publishList('approve', 'Approve').('enable').('enable2'); But to no avail. Any input? Link to comment https://forums.phpfreaks.com/topic/238602-sql-php-help/#findComment-1226206 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.