SyntaxFix
Write A Post
Hire A Developer
Questions
The while increments the i. So you get:
data[1][0] data[2][0] data[3][0] ...
It looks like name doesn't match any of the the elements of data. So, the while still increments and you reach the end of the array. I'll suggest to use for loop.