01-21-2021, 12:21 PM
model:
controllers
View
prints me only one record from the table,
I have 2 records in the table
?
PHP Code:
public function getDatum($datum_id)
{
$db = \Config\Database::connect();
$builder = $this->db->table('dnevnik_zapis');
$builder->select('*');
$builder->join('dnevnik_datum', 'datum_id = datum_dnevnik_id');
return $builder->getWhere(['datum_id' => $datum_id]);
controllers
PHP Code:
public function datum($datum_id)
{
$model = new Dnevnik_model();
$data['datum_id'] = $model->getDatum($datum_id)->getRow();
echo view('dnevnik_datum_view', $data);
}
View
PHP Code:
<?= $datum_id->dnevnik_id;?><br>
<?= $datum_id->datum_d;?><br>
<?= $datum_id->datum_dnevnik_id;?><br>
<?= $datum_id->opis;?><br>
prints me only one record from the table,
I have 2 records in the table
?