Hi,
I am trying to execute 2 queries and then output the results in 2 loops but
maybe I'm using the wrong approach.
Can anyone help me here ...
$query_1 = "SELECT field_1 FROM table_1";
$result_1 = mysql_query($qu ery_1) or die(mysql_error ());
$query_2 = "SELECT field_2 FROM table_2";
$result_2 = mysql_query($qu ery_2) or die(mysql_error ());
while ($row_1 = mysql_fetch_row ($result_1))
{
while ($row_2 = mysql_fetch_row ($result_2))
{
print $row_1[0] . ' - ' . $row_2[0] . '<BR>';
}
}
Thanks in advance.
Paul.
I am trying to execute 2 queries and then output the results in 2 loops but
maybe I'm using the wrong approach.
Can anyone help me here ...
$query_1 = "SELECT field_1 FROM table_1";
$result_1 = mysql_query($qu ery_1) or die(mysql_error ());
$query_2 = "SELECT field_2 FROM table_2";
$result_2 = mysql_query($qu ery_2) or die(mysql_error ());
while ($row_1 = mysql_fetch_row ($result_1))
{
while ($row_2 = mysql_fetch_row ($result_2))
{
print $row_1[0] . ' - ' . $row_2[0] . '<BR>';
}
}
Thanks in advance.
Paul.
Comment