I am trying to dynamically load more posts into my system
This is my code...
$stmt = "
SELECT * FROM `acmPosting`
WHERE (`sender`='$thisID' AND `postType`='a')
OR (`recip`='$thisID' AND `sender`='$userID' AND `postType`='a')
OR (`sender` IN ($friendsArray) AND `recip`='$thisID' AND `postType`='a')
ORDER BY `timeSent` DESC LIMIT $startlimit,10";
if($stmtCount = $conn->query($stmt)){
if($stmtCount->fetchColumn() > 0){
$result = acmPosts($conn, $site, $userID, $stmt);
$jsonArray['a'] = $result;
$jsonArray['b'] = 'go';
}else{
$jsonArray['a'] = '<div class="thisOutput" style="padding:12px;">There are no more posts</div>';
$jsonArray['b'] = 'stop';
}
}
Everything works fine until it gets to the last set of posts AKA if the LIMIT is 100,10 but there are 105 posts in the call it won't call any to the fetchColumn().
I hope this question makes sense. Thanks in advance for any help you can give.
EDIT
How can I determine when I have reached the LIMIT and act accordingly
Your description is not very precise but maybe this is what you are looking for:
http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.