Haydn Bowley
New member
<?php $count = 1;
do {
echo ("<p class='lite'>Subject" . $count . "</p>");
echo ("<select type='text' name='subject1' id='subject1'>");
echo ("<option selected='selected'>" . $row_pinnit_users['subject1'] . "</option>");
$count++;
// pulls every subject from data base
do {
echo ("<option>" . $row_pinnt_subjects['subject'] . "</option>");
} while ($row_pinnt_subjects = mysql_fetch_assoc($pinnt_subjects));
echo ("</select>");
} while ($count <= 4);
?>
This is the code I have so far.
It produces 4 drop downs which should show a list of all the subjects stored in the data base.
The problem is the bit where it pulls every subject from the database.
It lists all of them the first time the code is executed, but for the second, third and fourth loop no list of every subject is produced.
Any ideas as to what I'm doing wrong? - Thank you.
do {
echo ("<p class='lite'>Subject" . $count . "</p>");
echo ("<select type='text' name='subject1' id='subject1'>");
echo ("<option selected='selected'>" . $row_pinnit_users['subject1'] . "</option>");
$count++;
// pulls every subject from data base
do {
echo ("<option>" . $row_pinnt_subjects['subject'] . "</option>");
} while ($row_pinnt_subjects = mysql_fetch_assoc($pinnt_subjects));
echo ("</select>");
} while ($count <= 4);
?>
This is the code I have so far.
It produces 4 drop downs which should show a list of all the subjects stored in the data base.
The problem is the bit where it pulls every subject from the database.
It lists all of them the first time the code is executed, but for the second, third and fourth loop no list of every subject is produced.
Any ideas as to what I'm doing wrong? - Thank you.