Preview result of update/insert query without comitting changes to database in MySQL?
Posted
by Camsoft
on Stack Overflow
See other posts from Stack Overflow
or by Camsoft
Published on 2010-04-14T12:50:37Z
Indexed on
2010/04/14
13:03 UTC
Read the original article
Hit count: 244
I am writing a script to import CSV files into existing tables within my database. I decided to do the insert/update operations myself using PHP and INSERT/UPDATE statements, and not use MySQL's LOAD INFILE command, I have good reasons for this.
What I would like to do is emulate the insert/update operations and display the results to the user, and then give them the option of confirming that this is OK, and then committing the changes to the database.
I'm using InnoDB database engine with support for transactions. Not sure if this helps but was thinking down the line of insert/update, query data, display to user, then either commit or rollback transaction?
Any advise would be appreciated.
© Stack Overflow or respective owner