• Resolved rogersundstrom

    (@rogersundstrom)


    With $bandinfo->find(‘name ASC’, -1); I will find all “name” in my Pods(‘bandname’)
    How should my codes be if I only want to find all “name” there one of my Pods(‘bandname’) field(’eme_band’) = 1

    My code today

    <?php
    $slug = pods_url_variable('last');
    $bandinfo = pods('bandnamn');
    $bandinfo->find('name ASC', -1);
    $total_bandinfo = $bandinfo->getTotalRows();
    
         //initialize data array
        $bandinfo_data = array(); 
        //loop through all records and load into data array
        while ($bandinfo->fetch()) {
            $bandname = $bandinfo->field('name');
            $get_data = array(
    
                'bandnamn' => $bandinfo->field('name'),
                'slug' => $bandinfo->field('slug'),
                'artal' => $bandinfo->field('artal'),
    
            );
            if(!empty($bandname)) { 
                $bandinfo_data[0][$bandname][] = $get_data;
            }
       }
    ?>
    

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘find() from two fields in same pods’ is closed to new replies.