Jump to content

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.