- Joined
- Aug 4, 2010
- Messages
- 572
- Reaction score
- 177
I have this website where the user logs in and it displays their information and of course each other is assigned with a session ID which ?= [1][2][3] etc.
So per say I login with ID 1, and I can retrieve all my information from a table since its all in 1 TABLE.
How can I make a new table with new columns but keep the users ID's.
I don't know if i'm clear enough but i'll say it like this.
This is the original table with the users information..
TABLE (USERS) = [id] [name] [lastname] [password] [password2] [street] [city] [province]
This is another table that I want to make but still have its information connected to table 1.
TABLE (UserINFO) = [id] [coins] [friends] [votes]
so if I want to call it in a query like so
SELECT coins FROM UserInfo WHERE id = $_SESSION['user_id'] .
Would I have to have it insert the users ID from when they first register into UserInfo on the website ? or would I have to have it Insert new information into the new table. <-- Come to think of it I think I answered my own question.
But give me info on what I should do, Is it the JOIN function I need to use??
So per say I login with ID 1, and I can retrieve all my information from a table since its all in 1 TABLE.
How can I make a new table with new columns but keep the users ID's.
I don't know if i'm clear enough but i'll say it like this.
This is the original table with the users information..
TABLE (USERS) = [id] [name] [lastname] [password] [password2] [street] [city] [province]
This is another table that I want to make but still have its information connected to table 1.
TABLE (UserINFO) = [id] [coins] [friends] [votes]
so if I want to call it in a query like so
SELECT coins FROM UserInfo WHERE id = $_SESSION['user_id'] .
Would I have to have it insert the users ID from when they first register into UserInfo on the website ? or would I have to have it Insert new information into the new table. <-- Come to think of it I think I answered my own question.
But give me info on what I should do, Is it the JOIN function I need to use??