21,887
社区成员
发帖
与我相关
我的任务
分享
<?php
$sql="select id,pic,title from product where pic<>'' order by id desc limit 0,12";
$result=mysql_query($sql);
if(!$num=mysql_num_rows($result))
{
echo( "暂无产品数据!");
}
else
?>
<Br>
<table width="140" height="135" cellspacing="0" cellpadding="15">
<tr>
<?php
{
while($rs=mysql_fetch_array($result))
{
?>
<td><div align="center"><a href="product.php?id=<?=$rs["id"]?>" title="<?=$rs["title"]?>" ><img src="<?=$rs["pic"]?>" alt="<?=$rs["title"]?>" width="140" height="135" border="0" /></a><Br><Br>
<a href="product.php?id=<?=$rs["id"]?>" title="<?=$rs["title"]?>">
<?=msubstr($rs["title"],0,16)?>
</a> </div></td>
<?php
}
}
?>
<?php
$sql="select id,pic,title from product where pic<>'' order by id desc limit 0,12";
$result=mysql_query($sql);
if(!$num=mysql_num_rows($result))
{
echo( "暂无产品数据!");
}
else
?>
<Br>
<table width="140" height="135" cellspacing="0" cellpadding="15">
<tr>
<?php
{
$i=0;
while($rs=mysql_fetch_array($result))
{
if ($i%4==0)
echo "<tr>";
$i++;
?>
<td><div align="center"><a href="product.php?id=<?=$rs["id"]?>" title="<?=$rs["title"]?>" ><img src="<?=$rs["pic"]?>" alt="<?=$rs["title"]?>" width="140" height="135" border="0" /></a><Br><Br>
<a href="product.php?id=<?=$rs["id"]?>" title="<?=$rs["title"]?>">
<?=msubstr($rs["title"],0,16)?>
</a> </div></td>
<?php
}
}
?>
<?php
$sql="select id,pic,title from product where pic<>'' order by id desc limit 0,12";
$result=mysql_query($sql);
if(!$num=mysql_num_rows($result))
{
echo( "暂无产品数据!");
}
else
?>
<Br>
<table width="140" height="135" cellspacing="0" cellpadding="15">
<tr>
<?php
{
while($rs=mysql_fetch_array($result))
{
?>
<tr><td><div align="center"><a href="product.php?id=<?=$rs["id"]?>" title="<?=$rs["title"]?>" ><img src="<?=$rs["pic"]?>" alt="<?=$rs["title"]?>" width="140" height="135" border="0" /></a><Br><Br>
<a href="product.php?id=<?=$rs["id"]?>" title="<?=$rs["title"]?>">
<?=msubstr($rs["title"],0,16)?>
</a> </div></td></tr>
<?php
}
}
?>