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? Link to comment https://forums.phpfreaks.com/topic/105760-text-file-into-mysql-table/ 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. Link to comment https://forums.phpfreaks.com/topic/105760-text-file-into-mysql-table/#findComment-542065 Share on other sites More sharing options...
fenway Posted May 15, 2008 Share Posted May 15, 2008 Or use LOAD DATA INFILE. Link to comment https://forums.phpfreaks.com/topic/105760-text-file-into-mysql-table/#findComment-542157 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.