Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How do I access the results of this query from my template?

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

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

Page: 1
Go to End
Author Topic: 739 Views
  • sarahk
    Avatar
    Community Member
    46 Posts

    How do I access the results of this query from my template? Link to this post

    I just put /?showqueries=1 on a page I'm working on and found that I'm querying the database as follows:

    SELECT `Group_Members`.*, `Group`.*, `Group`.ID, if(`Group`.ClassName,`Group`.ClassName,'Group') AS RecordClassName FROM `Group` INNER JOIN `Group_Members` ON `Group_Members`.GroupID = `Group`.ID WHERE (`Group_Members`.MemberID = 1) GROUP BY `Group`.ID

    I want to check the results of this query and then display (or not) depending on what has been returned. I'll need to do a check first to see <% if CurrentMember %>.

    How do I access those query results?

    739 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.