prakash Posted October 11, 2009 Share Posted October 11, 2009 Hi, I have two mysql table in following format tbl1 ============================== user_name full_name ============================== test1@gmail.com Test 1 test2@gmail.com Test 2 test3@gmail.com Test 3 tbl2 ============================== email full_name ============================== test4@gmail.com Test 4 test5@gmail.com Test 5 test6@gmail.com Test 6 so how is it posible to list the data as following in a one mysql query? Result ============================== email full_name ============================== test1@gmail.com Test 1 test2@gmail.com Test 2 test3@gmail.com Test 3 test4@gmail.com Test 4 test5@gmail.com Test 5 test6@gmail.com Test 6 Quote Link to comment https://forums.phpfreaks.com/topic/177357-how-to-display-data-from-two-mysql-table/ Share on other sites More sharing options...
sKunKbad Posted October 12, 2009 Share Posted October 12, 2009 use UNION Quote Link to comment https://forums.phpfreaks.com/topic/177357-how-to-display-data-from-two-mysql-table/#findComment-935183 Share on other sites More sharing options...
prakash Posted October 12, 2009 Author Share Posted October 12, 2009 use UNION how does it works? Quote Link to comment https://forums.phpfreaks.com/topic/177357-how-to-display-data-from-two-mysql-table/#findComment-935329 Share on other sites More sharing options...
GKWelding Posted October 12, 2009 Share Posted October 12, 2009 http://dev.mysql.com/doc/refman/5.0/en/union.html (SELECT * FROM Table1) UNION (SELECT * FROM Table2) Quote Link to comment https://forums.phpfreaks.com/topic/177357-how-to-display-data-from-two-mysql-table/#findComment-935336 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.