开发者

Where should I display or store data that is imported from a file?

When I do an import of data from a file, such as csv or text file, I would like to display on a summary page (table view) about what is going to be imported to the database, and user can select or deselect what will be imported into the database. I would like to find out what is the best way of temporary storing these data to be displayed onto the summary page?

To give a clearer understanding about what i am talking about, for example:

  • I have a csv file that holds a list of products.
  • I would do an importation to read the csv file and display onto a summary page with table view and checkboxes to select/deselect some of the data.
  • After the selection, I would click the confirm button to store those chec开发者_如何学编程ked data

So between the process of getting the csv data to the summary page for display, where should I store the data, in the database as a tbl_temp data and clean off when done, or just read directly from the csv file?

Thanks.


I would think an array would do the trick unless you think your environment is really unstable or, for user interface reasons, then just store to a temp file. Temp db table seems a bit much.


I would just display it in the browser, and stored? It's already stored, the uploaded CSV file!

Unless you don't run into an actual problem with that approach, why care?


Just use HTML to display the data read from the file in a web browser. Use standard HTML Form and form controls. Use PHP scripting logic to control what happens when the form is submitted. You could have the submit button hand off to a service or some other php file that could handle writing it to the db.

Why bother writing to a temp table, to just read back out and display in a form to be then written back to a perm. table.

If this were a process that you would be performing a lot, i might give it a little more consideration.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜