In this tutorial, we will learn how to fetch one record from the database table using Codeigniter, we use row(). We can return one row from the database in CodeIgniter.
Use the row() function to return record.
Example:
<?php
$data = $this->db->get("items")->row();
print_r($data);
Output:
stdClass Object
(
[id] => 2
[title] => Codeigniter 3 CRUD Example
[description] => post description will be here.
[created_at] => 0000-00-00 00:00:00
[updated_at] => 0000-00-00 00:00:00
)
Thanks it will help you....