In general I am generating reports in excel from php and mysql (through consultations). What I do is that the records of my queries that I get are placed in an excel file that I create from php with the phpExcel library and I would like to know how I can add more data under those same records but knowing that the first result of my queries they throw me n records. Ie create 2 consecutive tables from php and put them in an excel file but not knowing the number of rows that will contain each one as they are dynamic.