You can easily to hand code all of it. First you need to create a "while" loop and insert one record at a time to your table. When the loop has finished its insert use a redirect method for going to another page:
header ("Location: your page URL"); // Redirect browser to other page
exit; // Closes further script execution
This function works when you have not sent any php or html command to output any thing in the browser. Care is to be taken not to send any other things to the browser after the header redirection using location command.
As for getting user number, you can simply store it in a variable and build your query arround it and then use a FOR loop with ++ to add sequentially to the record number.
I geuss you are wondering if dreamweaver can handle all this in its WYSIWYG environement. As your request is very particular I doubt if there is a pre-written peice of code that is desinged for your purpose.
hope this helps...