Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP MYSQL Table help
March 27, 2008, 7:24 pm
rate this thread
unique id. Now i want to create another table called profile where the
users can edit their profile and it will be stored in the profile
table. But i need to somehow connect the tables together so when the
user saves itll save the information in the table profile under their
id that they have in the users table.
Re: PHP MYSQL Table help
The level of the question you are asking is SQL 101. I suggest you do a
little studying on elementary sql, and there are a multitude of places
on the web with tutorials (just google "sql tutorial").
In answer to your question, the second table (tblProfile) would have a
column called, say, userID, and that would contain the ID from the first
table, users, for that user. You connect the two with a join either by
having a where clause (where tblProfile.userID = users.ID) or with a
join statement (join tblProfile on (tblProfile.userID = users.ID).
Really, though, this IS just SQL 101.
- The Natural Philosopher
March 27, 2008, 8:10 pm