I think you might be in over your head... What now is that you need to debug your php and determine exactly why it isn't working. You basically need someone with experience writing php and working with mySQL databases.
I admit that your descriptions alone make it difficult for me to fully conceptualize what you are doing, so I can't be sure if it can be accomplished with our tools alone without hand coding. It might be you are close, but it might be that you need to update a line or two of code by hand or it will never work... to determine that somebody that understands php code needs to debug your page.
We don't offer Mentor Training any more, but that is basically what you need. An experienced php and mysql engineer to debug your code for you and determine why it isn't working and maybe even write a line or two of code to make it work the way you want it to.
Maybe someone reading this forum with more experience will contract with you to help. Hopefully someone from the community can help. If you attach a copy of the page you are working on I'll look at it real quick to see what I can spot.
Send me a version using the manage relational table server behavior and not multiple inserts... Eric Mittman makes a good point.