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;
}
将其视为第二个查询,如果我正在运行限制为 5 的第一个查询,我将作为 $lastOutputId 作为参数发送 5,并且我想将此查询作为 5 到 5+5 运行,并且以同样的方式,下一个查询将以 10 到 15 的限制运行。我该怎么做?