mysql extra columns with same name from two tables

Posted by salmane on Stack Overflow See other posts from Stack Overflow or by salmane
Published on 2011-01-07T13:47:32Z Indexed on 2011/01/07 13:54 UTC
Read the original article Hit count: 105

Filed under:

Table 1 has columns : entry_id user_id ... Table 2 has columns : entry_id user_id ...

the user_id entry is not always the same so I would like to extract both of them so I can later on compare them in my script

SELECT * FROM 
table1 as t1
INNER JOIN table2 as t2 on t1.entry_id=t2.entry_id
WHERE t1.user_id='%s'

I would like to extract t1.user_id and t2.user_id ...the problem is the result array has only user_id

thank you

© Stack Overflow or respective owner

Related posts about mysql-query