Hi, I really need help with this. I read from various sources but they are complicated and I do not understand them at all. Is anyone kind enough to help how do I go about it?

Member Avatar for diafol

Easiest way - output to csv and then use usual method:

LOAD DATA LOCAL INFILE '/importfile.csv' 
INTO TABLE test_table 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 
(field1, filed2, field3);

there are also free sites out there that transform csv into sql.

if looking for excel to sql, you may have to use COM. or zend - php livedocx - may be similar thing for excel??

Easiest way - output to csv and then use usual method:

LOAD DATA LOCAL INFILE '/importfile.csv' 
INTO TABLE test_table 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 
(field1, filed2, field3);

there are also free sites out there that transform csv into sql.

if looking for excel to sql, you may have to use COM. or zend - php livedocx - may be similar thing for excel??

test_table is the table name right? terminated by ',' need to change? what else do i need to change?

Member Avatar for diafol

test_table is the table name right? terminated by ',' need to change? what else do i need to change?

Just the table name and the location of the csv file

why don't you use existing php-excel reader? this is the link code.google.com/p/php-excel-reader/. You don't have to convert excel file into csv. Just import excel file into mysql DB.
PS. as far as i know the class only handle .xls format

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.