减少加载PHP/SQL的图像
通过我的图像托管网站的管理员,我有一个页面,我可以拉上所有上传的图像。问题是,我认为它试图将它们全部拉出来,并导致网站崩溃超过5分钟。我如何限制什么负载?我尝试过查看用户库脚本是如何编写的(因为它一次只能加载15个左右,而您可以单击一个按钮来加载更多),但运气不好 我想一次最多50人减少加载PHP/SQL的图像,php,mysql,count,Php,Mysql,Count,通过我的图像托管网站的管理员,我有一个页面,我可以拉上所有上传的图像。问题是,我认为它试图将它们全部拉出来,并导致网站崩溃超过5分钟。我如何限制什么负载?我尝试过查看用户库脚本是如何编写的(因为它一次只能加载15个左右,而您可以单击一个按钮来加载更多),但运气不好 我想一次最多50人 <?php require_once 'header.php'; ?> <div class="well"> <h1><?=_('Pictures Administ
<?php require_once 'header.php'; ?>
<div class="well">
<h1><?=_('Pictures Administration') ?></h1>
<?php require_once 'admin-navigation.php'; ?><?php
if(count($pictures)) {
?>
<table class="table-bordered table-hover table-striped table-sortable table-condensed">
<thead>
<tr>
<th> </th>
<th><?=_('Title') ?></th>
<th><?=_('User') ?></th>
<th><?=_('Date') ?></th>
<th><?=_('Views') ?></th>
<th><?=_('Server') ?></th>
<th><?=_('Remove') ?></th>
</tr>
</thead>
<?php
foreach($pictures as $p) {
$user = ($p->username == NULL) ? 'Guest' : $p->username;
$image_main = $p->image_name;
$image_title = htmlentities($p->image_title, ENT_QUOTES);
$image_path = image_path($p);
$image_size = getimagesize($image_path);
if($image_size[0] > 124) {
$thumbnail = str_replace("original", "thumbnail", $image_path);
}else{
$thumbnail = $image_path;
}
?>
<tr>
<td>
<a href="<?=SITE_URL ?>/view-image/<?=$image_main ?>" target="_blank">
<img alt="" src="<?=$thumbnail ?>" /> </a></td>
<td><?php echo $image_title ?></td>
<td><?php if($user != 'Guest') : ?>
<a href="<?=SITE_URL ?>/user-gallery/<?=$p->username ?>" target="_blank">
<?=$p->username ?></a><?php else: ?>Guest <?php endif; ?></td>
<td><?=date("jS F Y", $p->image_date) ?></td>
<td><?=$p->image_views ?></td>
<td><?=$p->server ?></td>
<td>
<a href="<?=SITE_URL ?>/admin-pictures?remove=<?=$p->imageID ?>">
<b class="icon-remove-sign"></b></a></td>
</tr>
<?php
}
?>
</table>
<?php
}else{
echo _("No pictures yet!");
}
?></div>
<?php require_once 'footer.php'; ?>
客人
Post填充$picturesadd LIMIT 15的SQL在SQL查询字符串后面我在哪里可以找到它?Post填充$picturesadd LIMIT 15的SQL在SQL查询字符串后面我在哪里可以找到它?