<table border=1>
<?php
$conn = mysql_connect("localhost","root","");
mysql_select_db("art");
$sql = "select * from art order by id limit 0,10";
$rs = mysql_query($sql);
while($result = mysql_fetch_array($rs))
{
$title = $result['title'];
?>
<tr>
<td><?php echo $title;?></td>
</tr>
<?php } ?>
</table>代码是这样的,输出前十条,那么前三条后面加个代表"new"的图片,多谢了,请给个思想或者把上面的代码修改一下也可以
<?php
$conn = mysql_connect("localhost","root","");
mysql_select_db("art");
$sql = "select * from art order by id limit 0,10";
$rs = mysql_query($sql);
while($result = mysql_fetch_array($rs))
{
$title = $result['title'];
?>
<tr>
<td><?php echo $title;?></td>
</tr>
<?php } ?>
</table>代码是这样的,输出前十条,那么前三条后面加个代表"new"的图片,多谢了,请给个思想或者把上面的代码修改一下也可以
解决方案 »
- 如何将JavaScript中的数据传给PHP?
- LAMP无法识别office07的mimetype
- centOS下,已经设置了include_path, require_once失败
- php 如何做中英双语的网站?大体上给个思路。重点说一下数据库方面怎么处理 谢谢
- 大家猜一下,看谁能猜对
- class soapserver not found
- php 实现“多个”终端设备的“推送”功能
- 老是提示如Table 'gongan.wjtz' doesn't exist,可是我的库gongan中有表wjtz啊!
- 如何让程序识别模板中的图片自定义大小然后生成缩略图?
- 如何实现登陆查询资料问题
- 请问有没有单页面xajax关联下拉菜单的例子..?
- 如何用dreamwave 制作utf8 内码的网页! 以及一些问题
<?php
$conn = mysql_connect("localhost","root","");
mysql_select_db("art");
$sql = "select * from art order by id limit 0,10";
$rs = mysql_query($sql);
$i = 0;
while($result = mysql_fetch_array($rs))
{
$title = $result['title'];
?>
<tr>
<td><?php if($<3){ echo "新新闻图片...."; } echo $title;?></td>
</tr>
<?php $i++; } ?>
</table>
<?php
$conn = mysql_connect("localhost","root","");
mysql_select_db("art");
$sql = "select * from art order by id limit 0,10";
$rs = mysql_query($sql);
$i = 0;
while($result = mysql_fetch_array($rs))
{
$title = $result['title'];
?>
<tr>
<td><?php if($i<3){ echo "新新闻图片...."; } echo $title;?></td>
</tr>
<?php $i++; } ?>
</table>