Advanced PHP upload form
===

MySQL Table looks like this:
http://s47.radikal.ru/i118/1207/28/ffec2ae39041.jpg

Here's the code of the output:

							<li>
								<a class="thumb" href="library/<?php echo $row2['projectname']; ?>/<?php echo $row2['projectrecordnum']; ?>.<?php echo $row2['projectformat']; ?>" title="<?php echo $row2['projectrecordtitle']; ?>">
									<img src="library/<?php echo $row2['projectname']; ?>/thumbs/<?php echo $row2['projectrecordnum']; ?>.<?php echo $row2['projectformat']; ?>" alt="<?php echo $row2['projectrecordtitle']; ?>" />
								</a>
								<div class="caption">
									<div class="image-title"><?php echo $row2['projectrecordtitle']; ?></div>
									<div class="image-desc"><?php echo $row2['projectrecorddesc']; ?></div>
									<div class="download">
										<a href="library/<?php echo $row2['projectname']; ?>/<?php echo $row2['projectrecordnum']; ?>.<?php echo $row2['projectformat']; ?>" target="_blank">Download Original</a>
									</div>
								</div>
							</li>

Here's how the output looks:

							<li>

								<a class="thumb" href="library/ultima/2.jpg" title="Timbo DISPLACED">

									<img src="library/ultima/thumbs/2.jpg" alt="Timbo DISPLACED" />

								</a>

								<div class="caption">

									<div class="image-title">Timbo DISPLACED</div>

									<div class="image-desc">Made in 3ds Max, background, color and lens flare from Photoshop</div>

									<div class="download">

										<a href="library/ultima/2.jpg" target="_blank">Download Original</a>

									</div>

								</div>

							</li>

My problem is that I can't find a way to make form, that will create a number of fields that user wants, then uploads and writes each file info into a mysql (remember that the amount of files isn't definite).