我在我的php页面中使用了内部连接。问题是当我在mysql查询浏览器中启动查询时,它获取近6行。并且都是正确的,但是当我在我的php页面中使用它时,它只能读取一行。这是只有一个值..内部连接问题
while($row=mysql_fetch_array($result1))
{
while ($resultpoet = mysql_fetch_array($poet)) {
?>
<tr>
<td><?= $iCounter?>
. </td>
<td><? if(($row['roman']=="")&&($row['hindi']=="")) { ?>
<?=$row['name'] ?>
<? } else { ?>
<a href="sview.php?title=<?=$row['sid'] ?>">
<?=$row['name'] ?>
</a>
<? } ?></td>
<td width="216"><?
if($resultpoet['pstatus']!='u')
print '<a href="pview.php?title='.$resultpoet['pname'].'">'.$resultpoet['pname'].'</a>';
else
print $resultpoet['pname'];
?>
</td>
<td width="135"><?=$row['category'] ?></td>
<td width="67"><a href="songtitle_action.php?title=<?=$row['sid'] ?>"> Edit </a>
<input name="check[]" type="checkbox" value="<?=$row[s_id]?>" id="checkbox_<?=$row[sid]?>"></td>
<td width="75"><? if(($row['roman']=="")&&($row['hindi']=="")) { ?>
<a href="song_add_lyrics.php?title=<?=$row['sid'] ?>"> Add Lyrics</a>
<? } ?></td>
</tr>
<? }
$iCounter++;
}?>
是的,我忘了这么做......正确的..从一个小时以来一直困惑。 – Aditii
因为我在其他while循环中使用它,所以每次外部获取值时,它都会获取该特定列或元组的所有calue组。如何管理两个while循环? – Aditii
只要确保使用不同的变量名称,就可以嵌套while循环。 :) –