Jump to content

Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...