If you want to do it via a script, if you've got shell access you could use backticks to do a mysqldump, then use mysql to load it into the other table. Do something like
/path/to/mysql/bin/mysqldump --add-drop-table -e -u username -h host -ppassword PHOTO > dump.sql
Then follow that with
/path/to/mysql/bin/mysql -u user -ppassword -h host TEST < dump.sql
And delete the dump file.
mysql does have table backup and restore commands, but make sure you drop a table before you restore it.
Or you could write your own routine.