Codeigniter – check whether user already exists in database using Jquery and AJAX.
Today we will see how to check whether user already exists in database with Ajax and jquery. It is very easy.
We have to make sure that you have autoload “url” helper and “database” library in your application by defining that in autoload.php file.
Here is a test table as follows:
CREATE TABLE tbl_users (
uid int(11) NOT NULL AUTO_INCREMENT,
username varchar(100) DEFAULT NULL,
PRIMARY KEY (
here is your view:
Here is the controller code:
Here is the Model code:
– codeigniter check username exists –