While loop in another while loop to echo data from SQL
I have 2 tables, table 1 and table 2.
I want to echo all in table 1, an each time I echo all in table 1 I want
to echo all in tabel 2.
I know I can't write a code this form:
while($var = mysqli_fetch_assoc($result))
{
echo $var['data'];
while($var2 = mysqli_fetch_assoc($result2))
{
echo $var2['data2'];
}
}
So how am I supposed to write the code ???
No comments:
Post a Comment