Answer the question
In order to leave comments, you need to log in
How to write goods import correctly?
Greetings.
There is a task: to write the import of goods from a file into the database.
My solution is straight forward: I upload a file, parse it, put the data in a temporary table.
Then, using ajax, I make a request to the script, which selects values from the temporary table and inserts them into the table, or replaces them if necessary, adds new providers and properties if they are not there. The script has a condition - the maximum execution time (in my case, 1 second), and a check for the presence of data for import, when one of the conditions is met, the script returns a response to the client, and there it is already decided - a new request or the end of work, plus a progress bar.
Interested in whether the logic is correct and how it can be improved?
Is it better to do a lot of queries or unload tables at a time - change values, load back?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question