I would like to have this peace of code clarified:
unset($row['something']);
Because in my code, I use this to delete a number of columns from my results that I get from a query. I'm using this to get the array and walk through it:
$rows = array();
while($row = $result->fetch_assoc())
I need the columns to make other combined columns. Later when I try to do an export to csv file it is still showing the unset columns. Which should have been deleted using unset. So in the while I use the unset method to delete a couple of columns.
Really hope someone can help me with this because I don't know how to delete these columns from my array.
UPDATE:
public function getRows()
{
global $global_db_link;
$result = $global_db_link->query($this->getQuery());
$rows = array();
while($row = $result->fetch_assoc())
{
// This is where i use different columns to calculate something
// and make a new column out of it
unset($row['column_header']);
$rows[] = $row;
}
return $rows;
So this is it in a short version.