WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to set where in findRecords[URGENT] (2 posts)

  1. hava82
    Member
    Posted 1 year ago #

    Hi, I have added field 'related'. Now when I try to do something like $pods->findRecords('','','related='.get_the_ID()); I get mysql error. How to make search ? Thanks!

    PS. Sorry, have no time to read manual. Tried to read man but seems need more time then I have.

    [ don't bump ]

  2. Scott Kingsley Clark
    Member
    Posted 1 year ago #

    $pods->findRecords( 'id', -1, 'related_field_name_here.ID = ' . get_the_ID() );

    Change related_field_name_here to whatever the field name you have your relationship field set to.

    The first variable is for what to order by, the second is how many to return (1 or more, or you can set to -1 to return all), the third is for the 'where' parameter.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.