Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving records to another table.

Status
Not open for further replies.

kjspear

Programmer
Feb 13, 2002
173
US
I have a question about moving and deleting records from on table to another.

I set up a form that allows the user to accept or reject a record that was uploaded and placed in the main table.

I have it so that the user simply clicks on one of the two buttons and the record is copied to another table. This works fine.

However, I would like the same record which is still on the main table to be removed. I tried to use the delete command, but I received a 'Could not open. Database not found'.

Could this record simply be moved to the other table after the user selects it?

Any assistance will be appreciated.

Thanks
KJ
 
I haven't figured out how to delete the reecord yet.

Can this be done while the table is still opened? I'm using frames and the session command. Basically, when the user selects the record to copy to the other table, the page in the other frame updates the other table and refreshes the parent/main page and counts to the next record.

Thanks
KJ
 
or summarizing above in sql

insert into othertable(id,descr) values('$id','$descr');

delete from oldtable where id='$id';



 
hos2:

That's not correct.

kjspear:
The correct summary in SQL would be:

INSERT INTO tablename1 [(column list)] SELECT (column spec) FROM tablename2 WHERE (some criterion)

DELETE FROM tablename2 WHERE (same criterion)

Want the best answers? Ask the best questions: TANSTAAFL!!
 
yep that's more correct. I oversimplified it a bit to much ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top