I created the following loop
$x=1;
while($x<=$excel->sheets[0]['numRows'])
{
$y=1;
while($y<=$excel->sheets[0]['numCols'])
{
isset($excel->sheets[0]['cells'][$x][$y])? $excel->sheets[0]['cells'] [$x][$y] : '';
$y++;
$a1 = $excel->sheets[0]['cells'][$x][3];
$a2 = $excel->sheets[0]['cells'][$x][4];
$a3 = $excel->sheets[0]['cells'][$x][5];
//some code to store above variables a1, a2, a3 and give the output
}
$x++;
}
Explanation of the code:
The code above reads the excel sheet and stores the values and works like this for example, the cell at row 5 and column C would be accessed using the notation $obj->sheets[0][‘cells’][5][3]. In the excel each row corresponds to one record and each column associated metadata.
Now what I have tried to do is upload all the the metadata for the corresponding record as one iteration, but the code above treating each row and each column as one record.Rather than treating entire row as one record.
What have I done wrong in the above code?
or…