sandeepm Posted March 21, 2015 Share Posted March 21, 2015 I am very new to this i have a doubt i am trying a query in php the actual concept is i have data of one user in users table and the same users doing some transactions in transaction table so i need to display the data from two different tables in single view file how can join both tables in single query Note: users id is forgien key of transaction created_by please suggest me Link to comment Share on other sites More sharing options...
Ingolme Posted March 21, 2015 Share Posted March 21, 2015 If each row of one table corresponds to a row in the other table, then you can use a JOIN: http://www.w3schools.com/sql/sql_join_inner.asp If both tables have the same kinds of fields and you just want rows from both tables then you can use the UNION operator in SQL: http://www.w3schools.com/sql/sql_union.asp Link to comment Share on other sites More sharing options...
sandeepm Posted March 28, 2015 Author Share Posted March 28, 2015 i read one article, what says is the id store in temparary location so you need to re-create the table is it correct.... or not Link to comment Share on other sites More sharing options...
Ingolme Posted March 28, 2015 Share Posted March 28, 2015 I don't know exactly what you're trying to do, so I can't tell you what's correct or not. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now