QUOTE
data from DB1
data from DB2
data from DB1
...
...
...
Now ive got eh data pulled from the database i need to somehow put it in the order shown in the quotes, the only way i could think to do this was to nest the second While loop so i end up with this structure:
QUOTE
while (pull data from table1){
echo data from table one
while(pull data from table TWO){
echo table TWO data
}
}
the problem is it doesnt seem to run the second while loop, why is this? a problem with my code (see below) or just because nested While loops dont work?
CODE:
CODE
while($row_client = mysql_fetch_array($result_client)){
$client_ref = $row_client['reference'];
$client_subject = $row_client['subject'];
$client_question = $row_client['question'];
//while there are rows in ether table echo them.
echo "
<table bgcolor=#99ccff border=1 style=\"border-collapse:collapse; border-color:blue;\" width=49%>
<TR><TD>
<u><b>Client ref:</b> $client_ref <BR><BR> <b>Subject:</b> $client_subject </u>
</TR></TD>
<TR><TD>
$client_question
</TR></TD>
</table>";
echo "1";
}
While($row_team = mysql_fetch_array($result_team)){
$team_ref = $row_team['unique_ref'];
$team_respondent = $row_team['respondent'];
$team_response = $row_team['response'];
echo "
<BR><BR>
<table bgcolor=#ccffcc border=1 style=\"border-collapse:collapse; border-color:blue;\" width=49%>
<TR><TD>
<u><b>Response ref:</b> $team_ref <b>Respondant:</b> $team_respondent </u>
</TR></TD>
<TR><TD>
$team_response
</TR></TD>
</table>";
echo "2";
}
$client_ref = $row_client['reference'];
$client_subject = $row_client['subject'];
$client_question = $row_client['question'];
//while there are rows in ether table echo them.
echo "
<table bgcolor=#99ccff border=1 style=\"border-collapse:collapse; border-color:blue;\" width=49%>
<TR><TD>
<u><b>Client ref:</b> $client_ref <BR><BR> <b>Subject:</b> $client_subject </u>
</TR></TD>
<TR><TD>
$client_question
</TR></TD>
</table>";
echo "1";
}
While($row_team = mysql_fetch_array($result_team)){
$team_ref = $row_team['unique_ref'];
$team_respondent = $row_team['respondent'];
$team_response = $row_team['response'];
echo "
<BR><BR>
<table bgcolor=#ccffcc border=1 style=\"border-collapse:collapse; border-color:blue;\" width=49%>
<TR><TD>
<u><b>Response ref:</b> $team_ref <b>Respondant:</b> $team_respondent </u>
</TR></TD>
<TR><TD>
$team_response
</TR></TD>
</table>";
echo "2";
}
yes, its messy

