i want to copy data form one talble to another in mysql

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mujaffar
Forum Newbie
Posts: 13
Joined: Tue Dec 22, 2009 11:16 pm

i want to copy data form one talble to another in mysql

Post by mujaffar »

i want to copy data form one talble to another in mysql using join
what i want to do is copy data from temp table select id and correspoding name and add it to another table (data) by checking perticular id and insert name in the info column of (data) table

i have written query in mysql but it gives error the query is

UPDATE questions
SET questions.answer = temp.name
FROM questions INNER JOIN temp
ON questions.ID = temp.tempID

but it cant work it gives error as

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM questions INNER JOIN temp ON questions.ID = temp.tempID' at line 3

what should i do??
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: i want to copy data form one talble to another in mysql

Post by requinix »

Check your syntax.
Post Reply