Forum Moderators: coopster

Message Too Old, No Replies

xml file processing

         

jackvull

9:26 am on Jan 31, 2006 (gmt 0)

10+ Year Member



Hi
I have a site where another computer has uploaded files to my ftp domain an included an XML file with metadata about those files.

What I'd like to do is scan through the XML files, insert the data nito a database and then moved the files to a 'Processed' folder so that they are not scanned on the next run.

What I'm worried about is that if at any stage of this process, something goes wrong, then it will have inserted data without moving the files, or moved the file without inserting data, etc.

Is there a way to rollback the transaction in MySQL? I am comfortable monitoring for errors within my PHP script.

Thanks.

coopster

12:47 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yes, you can use transaction processing with MySQL InnoDB tables. This thread in which a member wanted to make sure that the Code was running reliable [webmasterworld.com] has some beginning discussion and the links within that thread offer more in depth options.