Page 1 of 1

Export a result set as an SQL dump

Posted: Tue Sep 25, 2007 6:14 am
by batfastad
Hi everyone

I need to delete some data from a database, but it's only selected data.
We need to re-enter a selection of orders into our order system because they were done incorrectly.

I have the query which returns the data, and I was planning to just delete all those rows within phpMyAdmin.

I've backed up the data to an Excel file, and taken numerous dumps of the whole table.

But I was wondering if anyone knows of a script or program that can give me an SQL dump of only the result set, not the entire table?
Then if something goes wrong, I can just paste the SQL dump into the SQL window of phpMyAdmin to restore those rows of data.


I use phpMyAdmin and the MySQL Query Browser and neither have the option to export a result set as SQL... only CSV, Excel, PDF report, PLIST etc.

Does anyone know of a PHP script or utility that will let me do this?
I don't have the time to write a PHP script myself.

Thanks
Ben

Posted: Tue Sep 25, 2007 8:08 am
by Begby
Try working with a GUI to do this. A really good one is EMS SQL Manager 2007 for MySQL. You can get a free 30 day trial. It will let you export any result set as SQL, import directly from excel, mow your lawn, make you dinner etc. etc.

Posted: Tue Sep 25, 2007 8:37 am
by batfastad
Wow what an excellent bit of software! :lol:
Thanks for the suggestion, got it sorted!!