Jump to content

Text File Into MySql Table


brown2005

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.