Never mind, Savok. Please ignore my previous message. I did not read through your code fully. Sorry !
Anyway, I am surprised why the aligning did not happen automatically. Could you try to use aliases for the column names during the fetch ? This way, you do not have to specify the column names...