brown2005 Posted May 15, 2008 Share Posted May 15, 2008 I have a text file 'Table1' set out like this 1 10/5/2008 00:00:00 £51654.00 2 1/1/2008 00:00:00 £51.00 3 1/6/2007 00:00:00 £651.00 4 1/1/2009 00:00:00 £165.00 and a MySql table 'invoices' id date amount what I want to do is put the details in the text file into my mysql table.. how would I do this please? Quote Link to comment Share on other sites More sharing options...
KenDRhyD Posted May 15, 2008 Share Posted May 15, 2008 The simplest approach would be to write a small program (in PHP or any other language) to read the text file and generate SQL to populate the database, and then execute the script against the database. Similarly the program could directly execute the SQL against the database. Quote Link to comment Share on other sites More sharing options...
fenway Posted May 15, 2008 Share Posted May 15, 2008 Or use LOAD DATA INFILE. Quote Link to comment 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.