What happens in my PHP code is this: I make a query in the database and with that a DO WHILE (while that query returns records), it displays some information on the screen (based on the query, of course). Until then, all right. However I need now, within this DO WHILE, to place another, to go through another query and 'start' other values. I need this within another DO WHILE why the new query will always be according to the ID generated in the first query, that is, different for each iteration. Tests in different ways but did not run or get error. How can I have a "while" and within this, after the "do", have another?
Ex:
do{
do{
while($consulta2 = mysql_fetch_assoc($dados2));
while($consulta = mysql_fetch_assoc($dados));