• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.