I have a lot of data to export it in csv file. My function loop into each field and execute a function to get data from sql table. Now i have a very big database and i want to export some data without changing the memory_limit config because i don't want block others users.
How can i do to execute my function ?
For example : I have 100000 persons and each person have à lot of version of some datas. Each day they save an information like this :
Person Table
+-----------+-------------+-------------+
| id_person | name_person | city_person |
+-----------+-------------+-------------+
| 1 | Jack | Paris |
+-----------+-------------+-------------+
| 2 | John | London |
+-----------+-------------+-------------+
| ... | ... | ... |
+-----------+-------------+-------------+
| 99999 | Rose | Madrid |
+-----------+-------------+-------------+
| 100000 | Jackie | Rome |
+-----------+-------------+-------------+
Field Table
+----------+------------+-------------------+
| id_field | name_field | label_field |
+----------+------------+-------------------+
| 1 | Location | Visited location |
+----------+------------+-------------------+
| 2 | Article | Count of articles |
+----------+------------+-------------------+
| ... | ... | ... |
+----------+------------+-------------------+
| 289 | Distance | Distance |
+----------+------------+-------------------+
| 299 | Pause | Time of pause |
+----------+------------+-------------------+
Field Value Table
+----------+----------+-----------+----------------+------------+
| id_value | id_field | id_person | value | Date |
+----------+----------+-----------+----------------+------------+
| 1 | 1 | 148 | Hanover Street | 2015-05-10 |
+----------+----------+-----------+----------------+------------+
| 2 | 66 | 57962 | 20 | 2015-05-10 |
+----------+----------+-----------+----------------+------------+
| ... | ... | ... | ... | |
+----------+----------+-----------+----------------+------------+
| 3475992 | 105 | 847 | 17,5 | 2018-02-01 |
+----------+----------+-----------+----------------+------------+
| 3475993 | 15 | 66359 | 44 | 2018-02-01 |
+----------+----------+-----------+----------------+------------+
Each Field have a specific function to get data.
How can i get all the datas for export in csv file without change the limit memory ?
Thanks