Since in the referred line you only index the $table
array, the error output means that the $table
array does not have an element indexed by 1, 2, 3 or 4.
Without further information about your code, it is unclear why those elements do not exist. I suggest you to output the content of the $table
array for debug purposes and compare it with the data that should be there.