where in clause order issue
I'm an idiot!   All I needed to do was add ORDER BY FIELD(id,5,2,6,8,12,1...)
to my code.  I like it when the answer is an easy one.  I just wish it wouldn't take me so long to figure out!