I need code to archive a table in a database. This means i want to copy an existing table and save it as something else?
Look in the MySQL manual for mysqldump.