Php export table, the amount of data is too large, how to batch uninterrupted export to the table?

now the amount of data is not much, but you need to go through the interface in the loop, so 504 will appear after a while. How to solve this problem? Can I pull and insert into the table page by page? Thank you

May.05,2022

configure nginx timeout

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b306a8-2bcf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b306a8-2bcf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?