Skip to main content
Participating Frequently
October 23, 2010
Answered

Help! Moving Data from Table to Another!

  • October 23, 2010
  • 2 replies
  • 1105 views

hi

my case is: that i have a 2 tables, the first one contains a personal information of an employee, and i have a form that displays these data of that employee.

so, i want when i submit this form, these data moves from the entire table to another table, so how i can do that?!

*i am using Dreamweaver CS5!

This topic has been closed for replies.
Correct answer bregent
INSERT INTO table1 (fld1, fld2, etc)
  SELECT fld1, fld2, etc
  FROM table2 WHERE.....;

Question: Why do you have 2 similar tables and why are you duplicating data? Isn't it enough to store the primary key of table2 in table1?

2 replies

Lawrence_Cramer
Inspiring
October 23, 2010

Need a few more details to be able to help.  Are you talking about visual tables your HTML documents or are you talking about tables in a database? Are you using a dynamic development language such as PHP or Coldfusion?

The answer to your question varies quite a bit based on your answers to the above questions.

--
Lawrence Cramer - *Adobe Community Professional*

http://www.Cartweaver.com
Shopping Cart for Adobe Dreamweaver
available in PHP, ColdFusion, and ASP

Stay updated - http://blog.cartweaver.com

SPrinceAzAuthor
Participating Frequently
October 23, 2010

thank you sir!

i am talking about database tables, i want to move a record (complete row) from table to table.

i am using php and mysql through Dreamweaver CS5.

i have 2 similar tables for employers, every employee has a unique id, i want when i submit a form to move all records (complete row) for the select employee to the other table.

hope u help me plz!

thank you very much

bregentCorrect answer
Participating Frequently
October 23, 2010
INSERT INTO table1 (fld1, fld2, etc)
  SELECT fld1, fld2, etc
  FROM table2 WHERE.....;

Question: Why do you have 2 similar tables and why are you duplicating data? Isn't it enough to store the primary key of table2 in table1?

BenPleysier
Community Expert
Community Expert
October 23, 2010

Hi,

You are not giving us much to go on. When you say table, do you mean a database table? If so, which database are you using? Do you have a serverside language? If it is not a database table, what sort of table are tou referring to? Do you have an online URL so that we can see your page in situ?

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!