Page 1 of 1

insert comma separate string into mysql

Posted: Tue Sep 30, 2003 12:44 pm
by Gargomel7
I have a series of strings that look like this:

MIKE|2411|09:32|3|0|0|0|0|06:13|49:45|00:00|00:00|00:00|9.6|0.0|87.1|3.3|0.0|0.0|0.0|0.1

TERRY|2061|09:03|0|0|2|0|0|00:00|237:32|00:00|04:17|00:00|0.0|10.7|87.5|0.0|0.0|1.6|0.0|02

ANN|2538|09:05|6|0|1|0|0|04:23|34:18|00:00|07:48|00:00|42.4|13.3|37.8|4.8|0.0|1.4|0.0|0.3

i can separate each of the strings by commas, by pipes or anything that would be necessary....

how do i insert them into mysql now?

Posted: Tue Sep 30, 2003 1:20 pm
by philippgerard
SQL:

Code: Select all

INSERT INTO table (field) VALUES ('".$string."');
or is there any special thing about that? don't think so. fieldtype: varchar.

Posted: Tue Sep 30, 2003 6:06 pm
by McGruff
See manual LOAD DATA INFILE (mysql.com).

If you've got phpMyadmin you can set up a LOAD easily without having to write any scripts.