public function getAllCelebDataFinal ($database,$celebrityId,$lastOutputId)
{
$getalldata = $database->executeObjectList("
SELECT *
FROM (
(SELECT v.vidId, NULL as newsId, NULL as photoId, NULL as imageFile,
v.title as vidTitle, NULL as newsTitle, v.videoLink AS vidLink,
NULL as newsVidLink, NULL as newDetail , v.addDate
FROM videos v
WHERE v.celebrityId='".$celebrityId."' AND v.isPublished=1)
UNION ALL
(SELECT NULL as vidId, n.newsId,NULL as photoId,NULL as imageFile,
NULL as vidTitle, n.title as newsTitle, NULL AS vidLink,
n.videoLink as newsVidLink, n.details as newDetail,
n.addDate
FROM news n
WHERE n.celebrityId='".$celebrityId."' AND n.isPublished=1)
UNION ALL
(SELECT NULL as vidId,NULL as newsId,p.photoId,p.imageFile,
NULL as vidTitle, NULL as newsTitle, NULL AS vidLink,
NULL as newsVidLink, NULL as newDetail , p.addDate
FROM photos p
WHERE p.celebrityId='".$celebrityId."' AND p.isPublished=1)
) results
ORDER BY addDate DESC
LIMIT 5");
return $getalldata;
}
これを 2 番目のクエリと見なします。制限 5 で最初のクエリを実行している場合、パラメーターとして $lastOutputId として 5 を送信し、このクエリを 5 から 5+5 として実行し、同じように次のクエリは制限 10 から 15 で実行されます。どうすればそれを行うことができますか?