Hi I am using the following code to get the next record in the database.
However if it is the last record I get an error.
Any ideas on how i can just skip the below code if the $track->id
is the last record?
Thank you
$nxt = $this->db->get_where("academytracks", ["id >" => $track->id]);
$nxt = $nxt->row();
$data['nxttrack'] = $nxt;
THE ERROR I GET
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Trying to get property of non-object</p>
<p>Filename: controllers/academy.php</p>
<p>Line Number: 126</p>
</div>