MySQL MASS insert

olliepop

Member
Messages
138
Reaction score
0
Points
16
Hi, how would i insert a file with a format like this:
0 0 0 0
0 1 0 0
0 2 0 0
0 3 0 0
0 4 0 0
0 5 0 0
0 6 0 0
0 7 0 0
0 8 0 0
0 9 0 0
0 10 0 0
0 11 0 0
0 12 0 0
0 13 0 0
0 14 0 0
0 15 0 0
0 16 0 0
0 17 0 0
0 18 0 0
0 19 0 0
0 20 0 0

directly into the database? The table i need to insert this MASSIVE file into has four columns, represented by each number in the file.

How would i do it without the painful INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
Just read line by line, explode() it on " " and repeat until you reach the end of the file.
 
Top