Category : Codeigniter


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 | | 66 Viewer | Category : Codeigniter
READ MORE

Codeigniter 3 - Generate PDF from view using dompdf library with example

In this tutorial, i am going to share with you how to create pdf file from html view using dompdf library in Codeigniter 3 application. We will integrate dompdf library from scratch so no issue if you don't know about dompdf library. We generally require to generate PDF for invoice, data, information, subscription etc. If you use any PHP framework like laravel, code php, yii etc then you have option to other package for generate HTML file into PDF. But if you are working on Codeigniter then you fetch problem to how to do it. But in this article i am going to give you very simple example to ht.....

By Hardik Savani | February 26, 2017 | | 1622 Viewer | Category : Codeigniter
READ MORE

Codeigniter 3 - CRUD(Create, Read, Update and Delete) using JQuery Ajax, Bootstrap, Models and MySQL

Today, i am going to share with you how to create CRUD Application with pagination using JQuery Ajax in Codeigniter 3. CRUD is a basic step of any Core Language or framework. CRUD stand for Create Read Update and Delete. So in this post we will learn insert update delete in codeigniter using jquery Ajax. I gave you example from scratch so if you don't know about Codeigniter 3 then no issue. You have to just follow simple step. There are listed bellow step you have to follow: <strong>1)Download Fresh Codeigniter 3</strong> <strong>2)Create Database and Configuration</strong> <strong>3)Add Ro.....

By Hardik Savani | February 19, 2017 | | 17791 Viewer | Category : Codeigniter
READ MORE

Codeigniter 3 - select2 ajax autocomplete from database example with demo

Today, I am going to show you how to make select2 dynamic autocomplete from database table in your Codeigniter application. In this post you can lean how to implement ajax autocomplete in your Codeigniter 3 project. Select2 is a Jquery plugin and it is a very famous jquery plugin, using select2 plugin we can do several thing like select box with search, select option with check box, ajax auto-complete etc. sometimes we require to do autocomplete task with select box when we have large amount of data like products, items, category, tags, users etc. so we can't load all the data at the same ti.....

By Hardik Savani | September 15, 2016 | | 8688 Viewer | Category : Codeigniter
READ MORE

Solved - Access Not Configured. Google+ API (truncated...) on google console developer

When i was working on my Laravel 5.3 application with socialite google API. I fetched one issue when redirect on my application. I had successfully created my project on google console with site URL and redirect back URL too. But when it was redirect back on path i found one error like "403 Forbidden - Access Not Configured. Google+ API (truncated...)". I did try my self but i can't solve this error. It was always return error on my screen like this way: <strong>"ClientException in RequestException.php line 107: Client error: `GET https://www.googleapis.com/plus/v1/people/me?prettyPrint=fal.....

By Hardik Savani | September 13, 2016 | | 2919 Viewer | Category : Codeigniter
READ MORE

How to get current url with query string in codeigniter?

If you require to get current URL with parameters in your codeigniter project then you can get easily using "url" helper. Codeigniter provide url helper library that way we can get existing page url or base url etc. you can also get only parameters without URL using "input" as like bellow. <pre> $parameters = $this->input->get(); </pre> But, we are getting full path using "url" helper and $_SERVER variable. So, you can see how to get full path using both as bellow: <strong>Example:</strong> <pre class="prettyprint lang-php"> $this->load->helper('url'); <br/> $currentURL = current_url(); $pa.....

By Hardik Savani | August 29, 2016 | | 1450 Viewer | Category : Codeigniter
READ MORE

Codeigniter - How to get current url in controller or view ?

Sometimes, we need to get current URL path in your controller file or view file. So, we can get simply using "url" helper. Codeigniter provide url helper library that way we can get existing page url or base url etc. current_url() through we can get current url in your Codeigniter application. But, you should load "url" helper before use current_url(). you can load url helper as bellow: <pre> $this->load->helper('url'); </pre> In bellow example, you can see code how can i get current url in your controller file. So, let's see. <pre class="prettyprint lang-php"> $this->load->helper('url'); <b.....

By Hardik Savani | August 2, 2016 | | 796 Viewer | Category : Codeigniter
READ MORE

How to get Ip Address in Codeigniter?

If you are work on Codeigniter application and you require to get client ip address then you can get easy. you don't need to use $_SERVER variable like native PHP, but Codeigniter provide $this->input. you can fetch easy using following example: <strong>Example:</strong> <pre> $ip = $this->input->ip_address(); print_r($ip); </pre>

By Hardik Savani | June 13, 2016 | | 856 Viewer | Category : Codeigniter
READ MORE

Codeigniter Angularjs http post not working

Sometimes, you face problem you can't get post data using $this->input->post(), when you fire $http.post() using AngularJS or Jquery. I also face this issue, i can't receive post value when i fire $http.post in AngularJS, But i found how to receive post data or json data in Codeigniter controller. in following example through you can solve your problem: <pre class="language-php"> public function store() { $this->load->database(); $_POST = json_decode(file_get_contents('php://input'), true); $posts = $this->input->post(); $this->db->insert('posts', $posts); } </pre>

By Hardik Savani | February 22, 2016 | | 1308 Viewer | Category : Codeigniter
READ MORE

Codeigniter 3 and AngularJS CRUD with Search and Pagination Example.

In This tutorial i want to show you how to create CRUD(Create, Read, Update, Delete) using AngularJS in Codeigniter. I added few step to create create, edit, delete, lists, search and pagination application in your Codeigniter framework. In this tutorial through you can make simple crud, search and pagination module and easily use in your codeigniter project. I am going to show preview of items module that we will do using angularJS and Codeigniter 3. <strong>Preview:</strong> <img src="/upload/code-angular.png" width="100%" style="border:2px solid cadetblue" /> <strong class="step">Step 1: C.....

By Hardik Savani | February 21, 2016 | | 47907 Viewer | Category : Codeigniter
READ MORE

    Laravel 5 - Multiple Images Uploading using dropzone.js example with demo

    Laravel 5 - Multiple Images Uploading using dropzone.js example with demo

    Open Post

    Codeigniter 3 - select2 ajax autocomplete from database example with demo

    Codeigniter 3 - select2 ajax autocomplete from database example with demo

    Open Post

    How to send mail using mailable in laravel 5.3?

    How to send mail using mailable in laravel 5.3?

    Open Post

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 2

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 2

    Open Post

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Open Post

    Laravel 5 - Simple user access control using Middleware

    Laravel 5 - Simple user access control using Middleware

    Open Post