0

Hi,

Please help me... I am new to php and my sql. I need a code for uploading uploading the data from xls or xlsx file into my sql. Please give the code and help or send the code to futures.magesh@gmail.com..... Please help me.....

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by rch1231
0

Hello,

This may help. You can save an excel file as a CSV (Comma Seperated values) and then use mysqlimport or the load command.

Data files in CSV format contain values that are delimited by commas rather than tabs and that may be quoted with double-quote characters. For example, a CSV file mytbl.txt containing lines that end with carriage return/linefeed pairs can be loaded into mytbl using LOAD DATA:

mysql> LOAD DATA LOCAL INFILE 'mytbl.txt' INTO TABLE mytbl
    -> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    -> LINES TERMINATED BY '\r\n';

Or like this using mysqlimport:

% mysqlimport --local --lines-terminated-by="\r\n" \
               --fields-terminated-by="," --fields-enclosed-by="\"" \
               cookbook mytbl.txt
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.