Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:59:38+00:00 2026-05-26T11:59:38+00:00

I create items using pods, I want to filter through the pods depending on

  • 0

I create items using pods, I want to filter through the pods depending on what their relationship is.

Eg I have 2 relationships to pick from: “Good” or “Bad”

$pods_name = "attitude";
//get the specific pod object:
$thePod = new Pod($pods_name);
$thePod->findRecords(-1, "attitude.mood = Good");
//mood is the label of the relationship you can choose from (has
//the options between good or bad)

The problem with this is that it returns items in both Good and Bad.
I can’t see how they’re linked in the database, is there a more specific way you have to call it to find the records of only items listed under “Good”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:59:39+00:00Added an answer on May 26, 2026 at 11:59 am

    findRecords uses MySQL queries, you need to put your Good text into quotes.

    Also, follow the documentation used at: http://podscms.org/codex/findrecords/

    You likely are looking to use this code:

    $thePod->findRecords('t.name', -1, 'attitude.mood = "Good"');
    

    Though I suggest using the $params method:

    $thePod->findRecords(array('orderby' => 't.name', 'limit' => -1, 'where' => 'attitude.mood = "Good"'));
    

    Also, before putting something into findRecords dynamically (user-input), be sure to run esc_sql($value) on it before placing it into findRecords

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`v come across a need where I want to create multiple list items from
I'm trying to create a player who can add and remove items from their
I am using the following css to create list items with a chckerboard background
I have a list of items. When I create the list each item has
I have created the following view for users to create new items. Ive tried
I have items and itemgroup tables in my database: CREATE TABLE [items]( [item_id] [int]
I have 2 tables in my database: CREATE TABLE [items]( [item_id] [int] IDENTITY(1,1) NOT
I am using ZedGraph to create a pie chart, and adding items to it
I'm working in ASP .NET 4.0 and using the FormView to view/edit/create items in
I want to create menu using GTK+. My question is: is there any way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.