HDTuto.com

Codeigniter


Codeigniter 3 - Order by random records from mysql database example

If you are finding way to how to get random records from mysql table in codeigniter project then you are a right place. You can easily get random rows using codeigniter query builder order_by. here you will see the example of getting random result using order_by in codeigniter 3. In order_by(), we have to pass two argument parameter, one is a column name and another is a 'RANDOM' then codeigniter.....

Posted On July 19, 2018

How to use multiple where condition in Codeigniter?

Hi Guys, Here, i will show you how to write multiple condition in where clause using codeigniter 3 Query Builder class. Codeigniter provide set class function for each mysql function like where clause, join etc. So same for where clause, they provide "$this->db->where($array);", so we can use easily. In this tutorial, you can see two way to add multiple where condition in your codeigniter applica.....

Posted On July 19, 2018

How to insert multiple rows in Codeigniter?

In this tutorial, we will learn how to insert multiple records into a MySQL table using CI's active records library. Sometime, We may require to insert multiple rows instead of single records. It also takes a few time and adds multiple rows in a database table. Codeigniter 3 have an active records library and they provide insert_batch() to create multiple records at a time. So I also added a smal.....

Posted On July 19, 2018

Codeigniter 3 - How to get all routes?

Hello Developer, In this tutorial, i will show you how to get all routes list in codeigniter application. Actually, few days ago i was creating one example on codeigniter 3 project. But when i access route from url it show me 404 not found page. i thought error from index.php or something, but tried that way and nothing happen. Then i plan to get list of all routes and check i created route succ.....

Posted On July 13, 2018

How to remove index.php from url in Codeigniter 3?

Here, I will let you know how to remove inde.php from url using .htaccess in codeigniter project. As we know, codeigniter run index.php and with another route, it's come with index.php file in url. I had same issue on my ubuntu. when i was working on my client project on localhost. i did remove index.php file from url using htaccess file. So, here you have to simply write below code on your .htac.....

Posted On July 12, 2018

PHP Codeigniter 3 - JQuery Ajax Form Validation Example

Hi Guys, Today we will learn how to add ajax form validation in codeigniter using javascript. we will create contact us form and form submit using ajax in codeigniter 3 app. we will use validation library of codeigniter and print error messages using ajax. We will implement server-side validation rules in codeigniter application on form submission using ajax. It is very simple to use ajax valid.....

Posted On June 5, 2018

Codeigniter 3 - call to undefined function site_url() Fixed

If you are fetching issue with undefined function site_url() in your codeigniter 3 application then you have to load "url" helper on auto load. I wanted to share this error, it will comes when you install fresh codeigniter 3 application and try to run, you will find this error undefined function site_url() when you use site_url() helper. So, if you used site_url() helper then you need to load "u.....

Posted On November 23, 2017

Codeigniter 3 undefined property $db in model - Fix

Hi, Guys If you have same issue, undefined property $db in codeigniter 3 application then you are a right place and i can help to fix this issue quick. If you used model and then you are directly going to use "$this->db" for access database table data. You will find this error "undefined property $db in codeigniter" If you are using codeigniter 3 project. However, we can resolve this issue in .....

Posted On November 5, 2017

Codeigniter 3 - call to undefined function base_url() Fixed

Hi, Friends In this tutorial i will show you how to solve base_url() function not working in codeigniter 3. When i was starting to work on my codeigniter 3 project few days ago. I just followed to some tutorial from google. But when i used base_url() in codeigniter 3 project as explained in tutorial. After run project i found following error. "Fatal error: Call to undefined function base_url().....

Posted On November 5, 2017

How to send json response from controller in codeigniter ?

In this article, we will learn how to send json response from controller method in codeigniter application. When we work with jquery ajax at that time we need to manage using json. If you got error then it will return json array with error. So You can simple send json response from controller function in codeigniter application by following example: Let's see example as bellow: <strong class="ste.....

Posted On May 20, 2017