CodeIgniter Forums

Full Version: Excel(csv) import with simple validation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
I use this all the time:
https://github.com/parsecsv/parsecsv-for-php

It's been perfect for me.