Jump to content

Community

Recommended Posts

I've been using constructLoadQuery to add table joins for member and group data without any problems but this won't work with the forums database. I assume due to the node permissions.

Is there a work around for this or should I just use get_fieldname and cache my database queries? (I've got several fields in the table I want to join with forum data.)

    protected static function constructLoadQuery( $id, $idField, $extraWhereClause )
    {
        /* Get parent contruct query */
        $parentDB = parent::constructLoadQuery( $id, $idField, $extraWhereClause );

        /* Add our custom join */
        $parentDB->join( 'basicpoints_forums', 'basicpoints_forums.forum_id=forums_forums.id' );

        /* Return all */
        return $parentDB;
    }
Link to post
Share on other sites
  • 1 month later...
  • Management

What is the MySQL error? It might just be a case of using arrays and parenthesis.

I've often been tripped up with the difference between:

$extraWhereClause = array( 'foo=?', $foo );

and:

$extraWhereClause = array( array( 'foo=?', $foo ) );

Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy