Welcome Guest, Not a member yet? Register   Sign In
Excel(csv) import with simple validation
#1

Hello Friends,
I have a product table called t_product
having just 4 fields
1. id (ai)
2. poroduct
3. generic_name
4. description
5. status
I have to populate this table from excel file.
I can easily import the file no issue but i have to check if a particular product exist it should not be imported at all.
How can i do that just share the logic (good if you have a code for it) should i import the data from excel to a temporary table and then do the checking or is it possible to import and validate simultaniously
Please Help
Reply
#2

(This post was last modified: 03-09-2017, 06:48 AM by AzrielOmega.)

Load into an array and use foreach and if else to check

I found this mySQL solution, only need to convert to CI query builder
http://stackoverflow.com/questions/31645...s-in-table

or this
http://stackoverflow.com/questions/35223...t/35223951
Reply
#3

I use this all the time:
https://github.com/parsecsv/parsecsv-for-php

It's been perfect for me.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB