Hello so this worked, however the data that is being placed in the excel sheet isn't lining up correctly. Some data is being placed on the same rows and such its not getting separated into the physical columns/rows as I have it in nuBuilder. The header row has all columns in each cell straight across the top for the number of rows in the db if that makes sense. I have attached a screen capture of the NuBuilder page along with what the excel sheet looks like. Any suggestions on how to fix this? I have attached photos
Also Excel will import CSV files in different ways, can be worth going through the menu
Data > Get External Data > From Text
to manully select the format and delimiter.
Thanks after I posted this, I figured out that I could do the following as well.. open a new page, blank doc, go to data, click cell a1 then do data from CSV. IS there away that I could make this export into a more readable excel file without doing this little trick. I didnt think of that until after I got keyboard happy and just posted.
pmjd wrote: ↑Tue Apr 05, 2022 3:56 pm
Try setting the delimiter (the character that will be used to seperate out the entries) as follows
Also Excel will import CSV files in different ways, can be worth going through the menu
Data > Get External Data > From Text
to manully select the format and delimiter.
Thank you I see the column headers are just listed as column 1, 2, 3, etc Im assuming it has to do with this section of the code. Could I replace this code with naming the columns or do you have another suggestion. Im not a php guy so sorry for the questions
//Get the column names.
$columnNames = array();
if(!empty($rows)){
//We only need to loop through the first row of our result
//in order to collate the column names.
$firstRow = $rows[0];
foreach($firstRow as $colName => $val){
$columnNames[] = $colName;