php 数据库图片信息及文件夹下的图片删除(7)
$sql="delete from pic where id=".$id;
mysql_query($sql);
$filename=$row['picpath'];
if(file_exists($filename)){
unlink($filename);
}else {
echo "图片路径不正确";
}
}
$sql="select*from pic";
$rst=mysql_query($sql);
$totalnum=mysql_num_rows($rst); //print_r($totalnum);exit;
$pagenum=5;
$page=$_GET["page"];
if($page==" "){
$page=1;
}
$begin=($page-1)*$pagenum;
$pagecount=ceil($totalnum/$pagenum);
$sql2="select * from pic order by id desc limit ".$begin.",".$pagenum." ";
$rst2=mysql_query($sql2);
while (@$row=mysql_fetch_array($rst2)){
?>
<li class="light-row" style="padding-top:2px; padding-bottom:2px">
<span class="list_width width_font"><a href="" target="_blank"><?php echo $row["picname"];?></a></span>
相关新闻>>
- 发表评论
-
- 最新评论 更多>>