laksh's avatar
Level 1

How to save CSV data into datatable

i created a popup in which we upload a csv file and after that i want to pull that csv data and save it into database so how do i perform that and i dont want to reload page after click on save Any help is appreciable

0 likes
2 replies
Tray2's avatar
  1. To submit something to the backend without reloading the page requires Ajax.
  2. Since you don't say how big that csv is, you can't assume that it only contains a few rows, so you should handle that with a job.
  3. You can either call a shell script that utilizes the database to import the csv, or you need to open it with php and loop over each row in it and insert them into the database.

Using the command line https://phoenixnap.com/kb/import-csv-file-into-mysql

Using Laravel https://dev.to/shanisingh03/how-to-import-excel-csv-file-into-laravel-4he3

jlrdw's avatar

Also what code do you have so far?

Please or to participate in this conversation.