daveuk Posted April 17, 2007 Share Posted April 17, 2007 Hi, I'm attempting to import a CSV file into MYSQL, so I'm looping each row and executing an INSERT against the database. Is there anyway of doing this as a transaction? I'm concerned about data being incorrect in the CSV which would cause the import to fail. Obviously parsing the CSV would be a first start, however, I'm curious to see if this can be done. Cheers Dave Quote Link to comment https://forums.phpfreaks.com/topic/47367-csv-import-into-mysql/ Share on other sites More sharing options...
bubblegum.anarchy Posted April 17, 2007 Share Posted April 17, 2007 verify all the data before inserting a single record... SQLyog has an import from csv feature. Quote Link to comment https://forums.phpfreaks.com/topic/47367-csv-import-into-mysql/#findComment-231074 Share on other sites More sharing options...
daveuk Posted April 17, 2007 Author Share Posted April 17, 2007 OK, thanks good to know that SQLYog has this feature, however, I would need to do it via code. Is it possible to retrieve the database types for each field from mysql? Thanks Dave Quote Link to comment https://forums.phpfreaks.com/topic/47367-csv-import-into-mysql/#findComment-231153 Share on other sites More sharing options...
cmgmyr Posted April 17, 2007 Share Posted April 17, 2007 Take a look at: http://www.phpfreaks.com/forums/index.php/topic,133807.0.html Quote Link to comment https://forums.phpfreaks.com/topic/47367-csv-import-into-mysql/#findComment-231184 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.