How to move dbase table record to another dbase table

I have a two dbase tables: “blog” and “blog_archives”.

I have a CMS with a list of blogs and and am trying to figure out a way to move the blogs selected via a checkbox and have them moved to the “blog_archives” table. Can someone give me some advice on how I can accomplish this?

Would I set up the command to INSERT into “blog_archives” and then create a DELETE record command afterwards? If so, that seems to be the easy part. The hard part for me would be to understand how to create a loop for all of the checked blogs to be moved.

I would appreciate some help!

here’s an idea – have just one table

then this whole INSERT/DELETE question becomes moot, yes?

unless your database is on a par with amazon and ebay, i don’t think you need to worry about archived rows in the same table, just flag them as inactive and bypass them when you’re querying the table

The query timing/structure is a database question, and so i’ve flagged this thread for moving.

As far as looping goes, foreach($_POST[‘fieldname’] AS $value) { } works… without knowing the table structure and what you need to move, i cant give more specific help.

Thanks StarLion. I’m sure I’ll have more to post regarding this issue.

so basically stick a field in the one table as ‘archived’ and have it set on a separate web page while the unarchived items bypass the archived.

hmm…didn’t think of that. Thanks r937!

I love you people.