username
password
desc
and so on down like this.
Can't say I feel like writing all this manually....
If your handy with PHP, you could write a script that would do it for you. You could use scandir() [us4.php.net] to get the list of files into an array then loop through them and manipulate the lines into mysql_queries and insert them. Hmm, easier said than done, huh?
Guess I have to do it with PHP. That was my original idea, but I kind of lack the knowledge how to do it.
So i use scandir() to scan all the files in the directory, then I read one file at the time, read each line of the file and insert them into the database. sound easy enough. Gotta try this...guess i'll be back here asking more! :)
Thanks for your quick responses!
[mysql.com...]
LOAD DATA [LOW_PRIORITY ¦ CONCURRENT] [LOCAL] INFILE 'file_name.txt'
[REPLACE ¦ IGNORE]
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY '\t']
[[OPTIONALLY] ENCLOSED BY '']
[ESCAPED BY '\\' ]
]
[LINES
[STARTING BY '']
[TERMINATED BY '\n']
]
[IGNORE number LINES]
[(col_name,...)]
Or for an example it would look like this (the LOCAL part doesn't work for me, so just put your file(s) on the server)
LOAD DATA INFILE 'C:\\WINNT\\TEMP\\MyFile.txt' INTO TABLE `MyTable` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
You can probably write a script to write this line of code 2000 times with the different filenames and tables.
I hope this helps!
BH