SQL问题 求大神解释下下面的语句是什么意思
select*fromnewstypeinnerjoinnewscontentonnewstype.newstypeid=newscontent.newstypeidor...
select * from newstype inner join newscontent on newstype.newstypeid=newscontent.newstypeid order by newsid
下面为全部语句
<?php
$sql="select * from newstype inner join newscontent on newstype.newstypeid=newscontent.newstypeid order by newsid";
$rs=mysql_query($sql);
?>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="tableBorder">
<tr>
<th>编号</th>
<th>新闻标题</th>
<th>发表时间</th>
<th>新闻类别</th>
<th>操作</th>
<th>删除</th>
</tr>
<?php
while($rows=mysql_fetch_assoc($rs))
{
?>
<tr>
<td align="center" class="forumRowHighlight"><?php echo $rows["newsid"]?></td>
<td class="forumRowHighlight"><?php echo $rows["newstitle"]?></td>
<td align="center" class="forumRowHighlight"><?php echo $rows["newstime"]?></td>
<td align="center" class="forumRowHighlight"><?php echo $rows["newstype"]?></td>
<td align="center" class="forumRowHighlight"><a href="modifynews.php?id=<?php echo $rows["newsid"]?>">查看修改</a></td>
<td align="center" class="forumRowHighlight"><a href="delnews.php?id=<?php echo $rows["newsid"]?>">点击删除</a></td>
</tr>
<?php
}
?>
</table> 展开
下面为全部语句
<?php
$sql="select * from newstype inner join newscontent on newstype.newstypeid=newscontent.newstypeid order by newsid";
$rs=mysql_query($sql);
?>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="tableBorder">
<tr>
<th>编号</th>
<th>新闻标题</th>
<th>发表时间</th>
<th>新闻类别</th>
<th>操作</th>
<th>删除</th>
</tr>
<?php
while($rows=mysql_fetch_assoc($rs))
{
?>
<tr>
<td align="center" class="forumRowHighlight"><?php echo $rows["newsid"]?></td>
<td class="forumRowHighlight"><?php echo $rows["newstitle"]?></td>
<td align="center" class="forumRowHighlight"><?php echo $rows["newstime"]?></td>
<td align="center" class="forumRowHighlight"><?php echo $rows["newstype"]?></td>
<td align="center" class="forumRowHighlight"><a href="modifynews.php?id=<?php echo $rows["newsid"]?>">查看修改</a></td>
<td align="center" class="forumRowHighlight"><a href="delnews.php?id=<?php echo $rows["newsid"]?>">点击删除</a></td>
</tr>
<?php
}
?>
</table> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询