I am facing some errors with my code, actually I've read another same problem, but I cannot catch the point to solve this error, I'm using controller to fetch almost all table called including **ppdb**, <-- this table show errors **Fatal Error** Call to a member function getPdb() on array in line 64

this my code 

```
<tbody>
    <?php 
        $no = 1;
        if(is_array($data->getPdb()) || is_object($data->getPdb())){ //This line 64
            foreach($data->getPdb() as $data){?>

            <tr>
                <td><?=$no++?></td>
                <td><?=$data['gelombang']?></td>
                <td><?=$data['tanggalbuka']?></td>
                <td><?=$data['tanggaltutup']?></td>
                <td><?=$data['tahunajaran']?></td>
                <td><?php  if($data['status']==1){echo 'Aktif';}else{echo 'Tidak Aktif';}?></td>
                <td>
                    <a href="inc/editTa.php?status=<?php echo (($data['status'] ==1)?'2':'1');?>&id=<?php echo $data['id'];?>" class="btn btn-xs btn-<?php echo (($data['status']==2)?'success':'danger');?>"><i class="fa fa-<?php echo (($data['status']==2)?'check':'check');?>"></I></a>&nbsp<?php echo (($data['status'] == 2)?'AKtifkan':'Non Aktifkan');?>
                </td>
            </tr>
    <?php } } ?>
</tbody>

```

in my controller the code written like this:

```
    $getta = $this->pdo->prepare("SELECT * FROM ppdb");
    $getta->execute();
    $c = $getta->rowcount();
    if($c > 0){
        foreach($getta as $data){
            $hasil[] = $data;
        }
        return $hasil;
    }
}

```

And the error shown like this

```
Fatal error: Uncaught Error: Call to a member function getPdb() on array in D:\xampp\htdocs\nh\inc\view\admin\inc\ppdb.php:64 Stack trace: #0 D:\xampp\htdocs\nh\inc\view\admin\index.php(31): include() #1 {main} thrown in D:\xampp\htdocs\nh\inc\view\admin\inc\ppdb.php on line 64

```

Above this table I use another function to save the form and fetch the option:

```
<form class="form animated bounceIn" method="POST">
            <div class="form-group">
                <?php 
                    $data->createPpdb();
                 ?>
            </div>
            <div class="card">
                <div class="card-header bg-dark">
                    Setting Gelombang PPPDB
                </div>
                <div class="card-body">
                    <div class="form-group">
                        <input type="text" name="gelombang" title="Nama Gelombang" class="form-control" placeholder="contoh: Gelombang I">
                    </div>
                    <div class="form-group">
                        <input type="text" name="tanggalbuka" title="Tanggal Buka PPDB" class="form-control" placeholder="Pilih Tanggal" id="tbuka">
                    </div>
                    <div class="form-group">
                        <input type="text" name="tanggaltutup" title="Tanggal Tutup PPDB" class="form-control" placeholder="Pilih Tanggal" id='ttutup'>
                    </div>
                    <div class="form-group">
                        <select class="form-control" name="ta">
                            <option value="" disbaled>-Pilih Tahun Ajaran-</option>
                            <?php 
                                if(is_array($data->getTa()) || is_object($data->getTa())){
                                    foreach($data->getTa() as $data){?>
                                        <option value="<?=$data['tahunajaran']?>"><?=$data['tahunajaran']?></option>
                            <?php
                                    }
                                }
                             ?>
                        </select>
                    </div>
                </div>
                <div class="card-footer">
                    <div class="form-group">
                        <input type="submit" name="simpanppdb" class="btn btn-sm btn-success" value="Simpan">
                    </div>
                </div>
            </div>
        </form>

```

I'd read with similar problem from stacoverflow.com but I cannot get the point. 

Thank you for someone who save my day.