If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

In this way you can have many transactions in the transactions table and join it to the members table where the transaction.membe_id is equal to the member.id.

E.g.

Code:

This will get all data from the transaction table only
SELECT transactions.* FROM transactions WHERE member.id = THEIDOFTHEMEMBER;
This will get all data from both tables, but since both have an "id" field they will collide and you wont know which one is which, so you can give them aliases using AS. We already have a member_id field in the transaction table so we don't need to alias it.
SELECT *, transactions.id AS transaction_id FROM members, transactions WHERE transactions.member_id = members.id AND member.id = THEIDOFTHEMEMBER;
It is usually better to only SQL out the particular fields you need.

In this way you can have many transactions in the transactions table and join it to the members table where the transaction.membe_id is equal to the member.id.

E.g.

Code:

This will get all data from the transaction table only
SELECT transactions.* FROM transactions WHERE member.id = THEIDOFTHEMEMBER;
This will get all data from both tables, but since both have an "id" field they will collide and you wont know which one is which, so you can give them aliases using AS. We already have a member_id field in the transaction table so we don't need to alias it.
SELECT *, transactions.id AS transaction_id FROM members, transactions WHERE transactions.member_id = members.id AND member.id = THEIDOFTHEMEMBER;
It is usually better to only SQL out the particular fields you need.

In might be worth reading up on relational databases.

I have a mysql table called members that already has a username and password column for each user. I added the three columns ticket_date, ticket_num, ticket_result to that table.

I am sort of understanding what you are saying but I still don't understand how I can store multiple transactions of a user.

So by searching for all transactions in the transaction table which have a memberid of #, you can get all the transactions by user #. In this example Gravy was user #1 and therefore all the transactions in the transaction table with memberid 1, were transcations made by Gravy.

So by searching for all transactions in the transaction table which have a memberid of #, you can get all the transactions by user #. In this example Gravy was user #1 and therefore all the transactions in the transaction table with memberid 1, were transcations made by Gravy.

You really should read a book about relational databases.

Would there be a problem with storing a user's account balance in the table with the username and password or should a new table be created just for that?