时间:2021-07-01 10:21:17 帮助过:2人阅读
$sqlstr = "select count(*) as recount from photo";
$query = mysql_query($sqlstr) or die(mysql_error());
$result = mysql_fetch_assoc($query);
$recount = $result['recount'];
$pagesize = 3;
$page = isset($_GET['page'])? $_GET['page'] : 1;
$offset = ($page-1)*$pagesize;
$sqlstr = "select * from photo limit $offset, $pagesize";
$query = mysql_query($sqlstr) or die(mysql_error());
while($thread=mysql_fetch_assoc($query)){
echo '';
}
$id = isset($_GET['id'])? $_GET['id'] : 0;
$sqlstr = "select * from photo where id='".$id."'";
$query = mysql_query($sqlstr) or die(mysql_error());
$result = mysql_fetch_assoc($query);
if($result){
header('content-type:'.$result['type']);
echo $result['binarydata'];
}