04.07.2017, 00:44
Not familiar with the sql plugin, but it would make sense the row ids would start at 0. So try settingn i and j equal to zero first. This will also effect your array as you're currently not using the 0 slot.
You also use cache_get_field content with j as reference near the bottom. That could be the issue?
You also use cache_get_field content with j as reference near the bottom. That could be the issue?