Hello,
I have an input page where I can add a CD, MC, LP, etc... to the list of my musiccollection. In page one, you give it all details regarding, origin, title, artist, etc.. but also the number of tracks on the release.
Now I would like to add a second page where you can link tracks to this release.
For this I register the variables "atracks" (number of tracks) and "count2" (item-number) on the first page, and recall them on the page where I want to link the tracks.
I would like to have it return the input form for as many times as there are tracks on the CD, MC, LP, etc...
So I have to add a loop somewhere, but I don't know where. I can place WHILE, }, $a=$a+1 on some many positions, it made my head spin.
Any help is really appreciated! THANKYOU!!!!!!!!!!!!!!
Marijn
<?
// getting the item number to link the tracks to
include("../../../dbconnect.php");
session_register("count2");
session_register("atracks");
session_register("a");
$refer = $count2;
echo($a);
echo($atracks);
while ($a<=$atracks) {
?>
<FORM action="<?=$PHP_SELF?>" method="post">
<p><font size="3"><B>ADMINISTRATIVE AREA</B></font></p>
<table border="0" width="800">
<tr>
<td width="16%"><font face="Arial" size="2">artikelnr.:</font></td>
<td width="16%"><? echo($count2); ?></td>
<td width="17%"><font face="Arial" size="2">track:</font></td>
<td width="46%"><? include('track.php'); ?></td>
<td width="5%"><? include('tracknr.php'); ?></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="Submit1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
<?
if (isset($Submit1)) {
$result = mysql_query("SELECT * FROM shoptracklinks");
$row = mysql_fetch_array($result);
$query="insert into shoptracklinks (trackID,CDID,tracknr) values ('$trackID','$refer','$tracknr');"; mysql_query($query) or die(mysql_error());
$a=$a+1;
session_unregister("a");
session_register("atracks");
session_register("a");
}
}
?>😕