Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

JOIN and number of records (MoreThanOnePage and others)

Go to End



Community Member, 30 Posts

9 December 2008 at 4:32am


I'm using JOIN to get articles commented by user. Query works ok, but the number of result records is wrong. Predefined variables (NewsArticles.Pages, MoreThanOnePage and others) have wrong values (to big).
This is my query:

$doSet = DataObject::get(
$callerClass = "ArticlePage",
$filter = "`SiteTree`.ParentID = '".$this->ID."' AND `Name` = '".PssMember::currentUser()->Login."'",
$sort = "`SiteTree`.Created DESC",
$join = " JOIN `PageComment` ON `ArticlePage`.ID = `PageComment`.ParentID",
$limit = "{$SQL_start},2"

How can I get correct number of records? When use JOINs I have to manulay set this variables?