0
我覺得這是一個比任何事情都更爲邏輯的問題。數據庫具有通過源參考保存的圖片以及用於標籤的布爾值。 isLandscape = 1。我製作了一個系統,根據查詢的類型遍歷結果頁面。以下是我所面臨的一個例子。我只從第0頁 - >第22頁看到相同的12張照片。然後我開始看到新的。我想我只是忽略了這個bug,因爲直到現在我還沒有注意到它。我注意到的一件事是page22 * 12pictures = 264,它與所看到的第一張新照片ID相同。您可以看到錯誤here(只需將p更改爲不同的頁面)。在多個頁面上顯示標記圖像失敗
<?php
$pictureid = -1;
$startpage = 0;
$viewsection = -1;
$uid = -1; //user id
$amntperrow = 4; //how many pictures per row, must correlate with doThumb()'s switch case amounts
$maxrows = 3; //how many rows of pictures to drop
if(isset($_GET['pid']) && is_int(intval($_GET['pid']))) $pictureid = clean($_GET['pid']);
if(isset($_GET['sec']) && is_int(intval($_GET['sec']))) $viewsection = clean($_GET['sec']);
if(isset($_GET['p']) && is_int(intval($_GET['p']))) $startpage = clean($_GET['p']);
$result = generateResult(array("isFlowers"), $startpage);
//**snip** -- drawing thumbnails would happen here
function generateResult($types, $page) {
global $amntperrow;
global $maxrows;
$sqlWheres = "";
$idAmnt = ($amntperrow*$maxrows)*$page;
if(isset($types) && !empty($types)) {
if(count($types) >= 1) {
for($i = 0; $i<count($types); $i++) {
$sqlWheres .= $types[$i] . "='1'";
if($i < count($types)-1) $sqlWheres .= " AND ";
}
}
}
$result = "SELECT * FROM pictures WHERE ";
if(!empty($sqlWheres)) $result .= $sqlWheres . " AND " ;
$result .= " private='0' AND id >='" . $idAmnt . "' LIMIT " . ($amntperrow*$maxrows);
return $result;
}
?>
這看起來像是我忽略的一個明顯的缺陷。謝謝您的幫助。