What I am attempting to do is match the username stored in two tables, table1 and table2 and then pull the user_id of table 2.
Table1 has columns such as id, username, and other random info
Table2 has columns such as user_id, username, and other random info
What I am attempting to do in the end is select information from table1 to be displayed however so I can go to the correct id when i click the link I need the user_id out of table2
The following is pulling the user_id’s however I need all of the other information out of Table1 so I can echo it out in my page
select user_id
from login_users
where username IN ( select username from cpanel)
ORDER BY username DESC
Do a join as below:
OR
Here
a.*returns you all the columns ofcpaneltable, whileuseridis retrieved fromlogin_userstable.