说$name=mysql_result($result2, $i, "link_name");这一行
Warning: mysql_result(): supplied argument is not a valid MySQL result resource
source:
----------------------------------
<?
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 `table1` FROM `table2`, `table1` WHERE `$link_id`=$l";
$result2=mysql_query($query2);
$name=mysql_result($result2, $i, "name");
echo '<br/>';
echo $name;
$i++;
}
mysql_close();
?>
Warning: mysql_result(): supplied argument is not a valid MySQL result resource
source:
----------------------------------
<?
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 `table1` FROM `table2`, `table1` WHERE `$link_id`=$l";
$result2=mysql_query($query2);
$name=mysql_result($result2, $i, "name");
echo '<br/>';
echo $name;
$i++;
}
mysql_close();
?>