General Community > Scripting Help

Help with UPDATE TABLE

(1/1)

skb:
I need to update a table into my new database from an older database. Inserting the old records should be fine, if the newer records also remain intact.
I've tried various permutations and combination with the UPDATE TABLE command but keep running into syntax errors, as I am a total nerd.

Can someone please guide me.

d3vcho();:
Tell us how are you trying to do it, so we can tell you what's wrong.

skb:
Through PhPMyadmin on my Wamp local setup.

I finally got it with this command;


--- Quote ---INSERT INTO dbxxx.smf_tablename SELECT * FROM dbyyy.smf_tablename;
--- End quote ---

But not before working around a Duplicate Entry for Primary Key error with this;


--- Quote ---SET foreign_key_checks = 0;
TRUNCATE `tablename`;
SET foreign_key_checks = 1;
--- End quote ---

Navigation

[0] Message Index

Go to full version