here is my code. it only retrieve last inputted data.

How can i populate all data in a htnl table.


$id =new Register();
            foreach($test as $t=>$sid){
            <th>Document ID</th>
            <th>Personnel ID</th>
            <th>Docs Name</th>
            <th>Docs Num</th>
            <th>Docs Date</th>

                <td><?= $sid->gov_docs_id ?></td>
                <td><?= $sid->personnel_id ?></td>
                <td><?= $sid->docs_name ?></td>
                <td><?= $sid->docs_num ?></td>
                <td><?= $sid->docs_date ?></td>
                <td><?= $sid->filename?></td>
                <td><button type="button" onclick="javascript:location.href='/getfile/<?= $sid->gov_docs_id?>'">download</button></td>



Hi, remove the curly bracket } at line 8.

syntax error, unexpected end of file

this is the error i encountered when i removed the curly bracket at line 8

Line 36:


change it to:

<?php } ?>

Or to:

<? } ?>

In practice provide some space.

thanks for help cereal i'm now able to retrieve all data's