For Loop help

In the following code I am trying to make a multi dimensional array out of a flat array. When I inc the value id in the for look I get the correct item from the flat array but when the for loops back the id isn’t incremented.
So the for loops through a 6 part array 6 times when i want to loop through 2 times building a three part dimensional array.

i.e 6 values in the dataTable array, 2 arrays of 3 values in the listData array.

Any help on why it isn’t incrementing?

x = 1
for id=1, #dataTable do
print("value of id start " … id)
listData[x] = {}
listData[x].medName = dataTable[id]
next(dataTable)
if id < #dataTable then
id = id+1
end
listData[x].medDose = dataTable[id]
next(dataTable)
if id < #dataTable then
id= id + 1
end
listData[x].medDaily = dataTable[id]
if id < #dataTable then
id = id + 1
end
x = x+1
print("value of id loop end " … id)
end
[import]uid: 5297 topic_id: 4924 reply_id: 304924[/import]