<?php
$db=mysql_connect("localhost","root","dirdir");
mysql_select_db("wyx",$db);
mysql_query("set names 'gb2312'");
$SQL="select * from wyx_class order by wyx_classsort asc";
$Result=mysql_query($SQL);
if($Result)
{
//循环显示所有的栏目
while($Row=mysql_fetch_array($Result))
{
$wyx_classid=$Row["wyx_id"];
$wyx_classname=$Row["wyx_classname"];
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#93C8D2">
<td height="28" colspan="2" bgcolor="#E7E7E7" style="color: #000000; font-size: 14px; text-align: left;">
◎ <?php echo $wyx_classname ?>
</td>
<td align="right" valign="middle" bgcolor="#CCCCCC" style="width: 123px">
<div align="center">
<span style="color: #000000"><a href="list.php?id=<?php echo $wyx_classid ?>" target="_blank">更多</a></span></div>
</td>
</tr>
<?php
//显示栏目对应的文章
$sql="SELECT * FROM wyx_text WHERE wyx_class=$wyx_classid";
$conn=mysql_query($sql);
$rs=mysql_fetch_array($conn); //不要用while 了
?>
<tr bgcolor="#FFFFFF">
<td colspan="2" height="21" style="text-align: left"><img src="images/wyx_1.gif" width="10" height="10"> <?=$rs[wyx_title]?>
</td>
<td align="center" style="font-size: 14px; width: 123px;" height="21">[]
</td>
</td>
</tr>
</table><br/>
<?php
}
}
?>
$db=mysql_connect("localhost","root","dirdir");
mysql_select_db("wyx",$db);
mysql_query("set names 'gb2312'");
$SQL="select * from wyx_class order by wyx_classsort asc";
$Result=mysql_query($SQL);
if($Result)
{
//循环显示所有的栏目
while($Row=mysql_fetch_array($Result))
{
$wyx_classid=$Row["wyx_id"];
$wyx_classname=$Row["wyx_classname"];
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#93C8D2">
<td height="28" colspan="2" bgcolor="#E7E7E7" style="color: #000000; font-size: 14px; text-align: left;">
◎ <?php echo $wyx_classname ?>
</td>
<td align="right" valign="middle" bgcolor="#CCCCCC" style="width: 123px">
<div align="center">
<span style="color: #000000"><a href="list.php?id=<?php echo $wyx_classid ?>" target="_blank">更多</a></span></div>
</td>
</tr>
<?php
//显示栏目对应的文章
$sql="SELECT * FROM wyx_text WHERE wyx_class=$wyx_classid";
$conn=mysql_query($sql);
$rs=mysql_fetch_array($conn); //不要用while 了
?>
<tr bgcolor="#FFFFFF">
<td colspan="2" height="21" style="text-align: left"><img src="images/wyx_1.gif" width="10" height="10"> <?=$rs[wyx_title]?>
</td>
<td align="center" style="font-size: 14px; width: 123px;" height="21">[]
</td>
</td>
</tr>
</table><br/>
<?php
}
}
?>
解决方案 »
- 大家来看看这个网站
- php修改html文件
- 急!!!在线等
- php的网站刷新浏览速度感觉有点慢
- 我安装Imail后搞得IIs原来提供的那个SMTP服务器也无法启动了,但是Imail又无法反安装,怎么办???
- 急求PHP在线编辑器
- 判断从第一页传过来的数据,若数据库中不存该数据(ID字段),就打开注册页,并把数据传过去,否则打开出错页面,怎么做?
- wwwroot/Lib文件夹下有my.js,my.php,我想在wwwroot/logon的index.php包含这两包含文件,怎样实现?
- 对于一个导航栏设计的思考。
- PHP小白向各位大佬致敬,求解个小问题
- 用GD库在图片中显示长文本,如何根据图片宽度自动换行?
- 按照拼音首字母检索有效数据解决方法
<?php
$db=mysql_connect("localhost","root","dirdir");
mysql_select_db("wyx",$db);
mysql_query("set names 'gb2312'");
$SQL="select * from wyx_class order by wyx_classsort asc";
$Result=mysql_query($SQL);
if($Result)
{
//循环显示所有的栏目
while($Row=mysql_fetch_array($Result))
{
$wyx_classid=$Row["wyx_id"];
$wyx_classname=$Row["wyx_classname"];
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#93C8D2">
<td height="28" colspan="2" bgcolor="#E7E7E7" style="color: #000000; font-size: 14px; text-align: left;">
◎ <?php echo $wyx_classname ?>
</td>
<td align="right" valign="middle" bgcolor="#CCCCCC" style="width: 123px">
<div align="center">
<span style="color: #000000"><a href="list.php?id=<?php echo $wyx_classid ?>" target="_blank">更多</a></span></div>
</td>
</tr>
<?php
//显示栏目对应的文章
$sql="SELECT * FROM wyx_text WHERE wyx_class=$wyx_classid";
$conn=mysql_query($sql);
while($rs=mysql_fetch_array($conn)) //这里的循环是要显示的所有文章?,这里用个WHILE,你用了,好像用的不对
{
?>
<tr bgcolor="#FFFFFF">
<td colspan="2" height="21" style="text-align: left"><img src="images/wyx_1.gif" width="10" height="10"> <?=$rs[wyx_title]?>
</td>
<td align="center" style="font-size: 14px; width: 123px;" height="21">[]
</td>
</td>
</tr>
</table><br/>
<?php
}
}
}
?>
<?php
$db=mysql_connect("localhost","root","dirdir");
mysql_select_db("wyx",$db);
mysql_query("set names 'gb2312'");
$SQL="select * from wyx_class order by wyx_classsort asc";
$Result=mysql_query($SQL);
if($Result)
{
//循环显示所有的栏目
while($Row=mysql_fetch_array($Result))
{
$wyx_classid=$Row["wyx_id"];
$wyx_classname=$Row["wyx_classname"];
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#93C8D2">
<td height="28" colspan="2" bgcolor="#E7E7E7" style="color: #000000; font-size: 14px; text-align: left;">
◎ <?php echo $wyx_classname ?>
</td>
<td align="right" valign="middle" bgcolor="#CCCCCC" style="width: 123px">
<div align="center">
<span style="color: #000000"><a href="list.php?id=<?php echo $wyx_classid ?>" target="_blank">更多</a></span></div>
</td>
</tr>
<?php
//显示栏目对应的文章
$sql="SELECT * FROM wyx_text WHERE wyx_class=$wyx_classid";
$conn=mysql_query($sql);
while($rs=mysql_fetch_array($conn)) //这里的循环是要显示的所有文章?,这里用个WHILE,你用了,好像用的不对
{
?>
<tr bgcolor="#FFFFFF">
<td colspan="2" height="21" style="text-align: left"><img src="images/wyx_1.gif" width="10" height="10"> <?=$rs[wyx_title]?>
</td>
<td align="center" style="font-size: 14px; width: 123px;" height="21">[]
</td>
</td>
</tr>
<?php
}
?>
</table><br/> //这里应该改成这样
<?php
}
}
?>
<?php
$db=mysql_connect("localhost","root","dirdir");
mysql_select_db("wyx",$db);
mysql_query("set names 'gb2312'");
$SQL="select * from wyx_class order by wyx_classsort asc";
$Result=mysql_query($SQL);
if($Result)
{
//循环显示所有的栏目
while($Row=mysql_fetch_array($Result))
{
$wyx_classid=$Row["wyx_id"];
$wyx_classname=$Row["wyx_classname"];
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#93C8D2">
<td height="28" colspan="2" bgcolor="#E7E7E7" style="color: #000000; font-size: 14px; text-align: left;">
◎ <?php echo $wyx_classname ?>
</td>
<td align="right" valign="middle" bgcolor="#CCCCCC" style="width: 123px">
<div align="center">
<span style="color: #000000"><a href="list.php?id=<?php echo $wyx_classid ?>" target="_blank">更多</a></span></div>
</td>
</tr>
<?php
//显示栏目对应的文章
$sql="SELECT * FROM wyx_text WHERE wyx_class=$wyx_classid";
$conn=mysql_query($sql);
while($rs=mysql_fetch_array($conn));
{
?>
<tr bgcolor="#FFFFFF">
<td colspan="2" height="21" style="text-align: left"><img src="images/wyx_1.gif" width="10" height="10"> <?=$rs[wyx_title]?>
</td>
<td align="center" style="font-size: 14px; width: 123px;" height="21">[]
</td>
</td>
</tr>
<?php
}
?>
</table><br/>
<?php
}
}
?>