Fetch Single Row From Database in Codeigniter

Fetch Single Row From Database in Codeigniter

Today, We want to share with you Fetch Single Row From Database in Codeigniter.In this post we will show you how to fetch data by id from database in php, hear for how to get multiple rows from database in codeigniter we will give you demo and example for implement.In this post, we will learn about How to fetch single row from database in php codeigniter? with an example.

Fetch Single Row From Database in Codeigniter

There are the Following The simple About Fetch Single Row From Database in Codeigniter Full Information With Example and source code.

As I will cover this Post with live Working example to develop fetch single data in codeigniter, so the how to get num row in codeigniter for this example is following below.

READ :  Personal Online PHP HTML Editor Source Code

codeigniter get single row

php codeigniter Example

$products_data = $this->db->get("products")->row();

print_r($products_data);

E-junkie: Sell digital downloads online

E-junkie Provides a Copy-paste buy-now, and cart buttons for selling downloads, codes and tangible products on any website, blog, social media, email and messenger!

Also see:

  1. The Top 10+ Best Webinar Software Platforms For 2020-2021
  2. Build Your Future Godaddy Careers And Jobs
  3. Introduction To Web Hosting Services

Test Output:

stdClass Object
(
    [id] => 2
    [title] => PHP codeigniter database Example 
    [description] => how to get multiple rows from database in codeigniter : pakainfo.com
    [created_at] => 0000-00-00 00:00:00
    [updated_at] => 0000-00-00 00:00:00
)

We can also get single data fields value from object:

$products_data = $this->db->get("products")->row();
print_r($products_data->title);

Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Fetch Single Row From Database in Codeigniter.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

READ :  Laravel 6 Dynamic get and set config variables value