MySQL (or, ideally, PHP PDO) have some way of simulating transactions without actually committing them? (Can I get
MySQL or PDO to act as if data is inserted/deleted/updated, without actually committing any
'Inserted' data (people IDs, business IDs, phone number Ids, phone type IDs, etc.) should be stored somewhere, so that they can be retrieved if need be. Data shouldn't be written to the main database during testing/development, only when the script is complete and ready for production use.
The reason for asking is this: In developing a data-copying/transferring script, it's inconvenient to delete the test data out of the tables and reset
AUTO_INCREMENT before running the changed import script.
Alternately, should I ...
- Create my tables in memory at the start of the script and delete them at the end?
- Replicate the database (create a slave) for use in development and replace the slave with each modification to the script?
(There will be about 1000-2000 people imported, with up to 15 phone numbers for each person, 1 business for each person and up to 10 roles for each person.)