Gentlemen programmers, you need professional advice or an idea to increase the speed of the script in php. What the script does:
1. It loads, processes and csv-file with data, recording this file in MySQL database
2. Then the user enters certain data (in this case, the cost per unit of service from each of the well-known providers)
3. The script unloads an array of data from the database, processes each record using mysql _ fetch _ array, prefixing the provider and substituting the required cost + calculating the total cost (number of service units * cost) now using the if operator, as in practice He was faster switch-case. And it writes line by line to the * .xls file.
How can I optimize / speed up this script? Because when processing 40,000 entries, it returns a timeout message. yes and 15.000 records processes ~ 5 min.
Any ideas?