another basic question, but here it goes:
I have two tables. One table I just added to my database and one has been there since the beggining of my site. When people register for my site it creates a row in the first table with a column called user_id that is auto increment. The problem is, I need the table I just added to have the same user ids as the first table. How will I go about doing this besides having to manually update every userid? thanks.
transfering from one table to another
Moderator: General Moderators
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
Code: Select all
UPDATE table2 SET table2.userid=table1.userid WHERE table2.accountid=table1.accoutidwhat exactly does that piece of code do? I tried running only the part before that (as I am trying to update every single user id, not just one) but I got an error saying unknown table, even though I know the table existed. Whats going on?magicrobotmonkey wrote:WHERE table2.accountid=table1.accoutid
