Import CSV/Excel data into MYSQL database using codeigniter |
Hello Friends,
Today i came across a functionality where i need to import the CSV/Excel file in to MYSQL database via codeigniter. There is a special requirement from client where he can upload the CSV/Excel file in file upload field in HTML form and all data from CSV/Excel must import into MYSQL database table through PHP and remove the duplicates rows of data.But I faced some problems here. My problems is: 1.when the user upload the csv file,its enter into the MYSQL database,but it have duplicates data of about 3-4 row. 2. the data in csv file is about 8000 rows but the data insert in MYSQL db is only about 5000(included the duplicates data) 3.this error occur when the file stop import the data importcsv_error this is my view: Code: <!-- UPDATE PROCESS'S OUTPUT --> PHP Code: function processupload() and this is my model PHP Code: <?php
Be a pineapple,
stand tall, wear a crown, and be sweet, on the INSIDE.
Hey there,
Have you tried using phpExcel? I've been using it on a small site (single upload at a time) and it seems to work just fine for xls files. I don't have a need for csv, so it may not be exactly what you need.
Is the value of the "articleno" column unique for each record? What I am trying to understand is what makes a row a "duplicate"?
Hi Raymien and dave friend ,
Thanks for taking time to reply,I have figure out how to solved this.
Be a pineapple,
stand tall, wear a crown, and be sweet, on the INSIDE.
|
Welcome Guest, Not a member yet? Register Sign In |