Tag : Record


How to get last record from MySQL table in Codeigniter?

In this post we are going to learn how to get last single record from MySQl database table using Codeigniter database library. We sometime require to get only single row result in our Codeigniter application. In this post you can see how to get whole last record using Codeigniter db query. Few day ago i posted <a href="http://itsolutionstuff.com/post/how-to-get-last-inserted-id-in-codeigniterexample.html" target="_blank">"How to get last inserted id in Codeigniter?"</a>, in that post we can simply get last inserted id from Codeigniter db query. In this database query i used order_by(), limit.....

By Hardik Savani | March 9, 2017 | | 1565 Viewer | Category : MySql Codeigniter
READ MORE

How to get last inserted id in Codeigniter?

Sometimes, we require to get last insert record id from database in controller, so in this example we will learn how to get last inserted row id in Codeigniter 3 project. It's very often need to get last insert id in programming field, if you are working on Codeigniter framework and you want to fetch last created id, i mean max id, then you do easily.Codeigniter provide method insert_id() to get last inserted id. insert_id() is function of "db" library. db library provides several function for connecting database task. insert_id() will return id of last inserted record. So here i give contro.....

By Hardik Savani | February 28, 2017 | | 1246 Viewer | Category : MySql Codeigniter
READ MORE

How to get last record of database table in Laravel?

Sometimes we may require to get only last record of table in our project, we can get several way. We can fetch last record of database table using latest() or orderBy(). In bellow example you can see how i get then last record of table. I have "items" table and i want to get last record of "items" table. In first example i use latest() with first() because latest() will fetch only latest record according to created_at then first() will get only single record: <strong>Using latest() belong to created_at field:</strong> <pre class="prettyprint lang-php"> $last = DB::table('items')->latest()->f.....

By Hardik Savani | July 14, 2016 | | 7598 Viewer | Category : Laravel
READ MORE

How to insert multiple records in Laravel 5?

If we work on big project and then we maybe require to add multiple rows on database using laravel eloquent. Laravel provide insert method for bulk records create on db. In bellow example you can see i use multidimensional $myItems array variable and that insert multiple records same time using DB::insert(). So let's see and try this. <strong>Example:</strong> <pre class="prettyprint lang-php"> $myItems = [ ['title'=>'HD Topi','description'=>'It solution stuff'], ['title'=>'HD Topi 2','description'=>'It solution stuff 2'], ['title'=>'HD Topi 3','descriptio.....

By Hardik Savani | June 13, 2016 | | 9022 Viewer | Category : Laravel
READ MORE

    Multi select autocomplete jquery example with code

    Multi select autocomplete jquery example with code

    Open Post

    Dynamic Autocomplete search using Bootstrap Typeahead JS Example

    Dynamic Autocomplete search using Bootstrap Typeahead JS Example

    Open Post

    How to implement lazy loading image with example for your website?

    How to implement lazy loading image with example for your website?

    Open Post

    Laravel 5 amazon s3 file upload tutorial - Part 1

    Laravel 5 amazon s3 file upload tutorial - Part 1

    Open Post

    How to disable model timestamps in Laravel 5.3?

    How to disable model timestamps in Laravel 5.3?

    Open Post

    Laravel 5.3 - import export csv and excel file into database

    Laravel 5.3 - import export csv and excel file into database

    Open Post