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”?
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:
Though I suggest using the $params method:
Also, before putting something into findRecords dynamically (user-input), be sure to run esc_sql($value) on it before placing it into findRecords