<?
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM `table1`";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < 15) {
$l=mysql_result($result, $i, "id");
echo $l;
$query2="SELECT * FROM `table2` WHERE `$link_id`=$l";
$result2=mysql_query($query2);
$name=mysql_result($result2, $i, "name");
echo '<br/>';
echo $name;
$i++;
}
mysql_close();
?>
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM `table1`";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < 15) {
$l=mysql_result($result, $i, "id");
echo $l;
$query2="SELECT * FROM `table2` WHERE `$link_id`=$l";
$result2=mysql_query($query2);
$name=mysql_result($result2, $i, "name");
echo '<br/>';
echo $name;
$i++;
}
mysql_close();
?>