• Resolved Nikolaiii

    (@nikolaiii)


    Hi,

    I am using the tutorial from the find function the doc but can’t find a way to pull the ID of a Simple Relationship (custom defined list). I defined ID|VALUE such as the following:

    1|Easy
    2|Moderate
    3|Hard
    4|Very Hard

    I can’t find if there is specific magic tag to pull the ID from a relationship. I tried .ID without success. Can you please guide me into the right direction?

    
    // Here's how to use find()
    $params = array(
        'limit' => 3, 
        'page' => 2, 
        // Be sure to sanitize ANY strings going here
        'where'=>"category.name = 'My Category'"
    );
    
    // Run the find
    $mypod = pods( 'mypod', $params );
    
    // Loop through the records returned
    while ( $mypod->fetch() ) {
        echo $mypod->display( 'myrelationship' ) . "\n";
    }
    

    This is returning the value “Easy” by example, and what I want is the ID (ex: 1).

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to pull the ID of a relationship using the find function’ is closed to new replies.