Auto suggestion using Ajax, jQuery and PHP

Must Read : Auto suggestion using Ajax, jQuery and PHP

Step 1: Creating database table for auto suggestion application
CREATE TABLE IF NOT EXISTS autosuggession (
user_id int(11) NOT NULL AUTO_INCREMENT,
username varchar(50) NOT NULL,
PRIMARY KEY (user_id )
);

Now we insert some row in our table
INSERT INTO autosuggession (user_id, username) VALUES (NULL, ‘De Gea’), (NULL, ‘Rafael’), (NULL, ‘Shaw ‘), (NULL, ‘Jones’), (NULL, ‘Rojo’), (NULL, ‘Evans’), (NULL, ‘Di Maria’), (NULL, ‘Mata’), (NULL, ‘Falcao’), (NULL, ‘Rooney’), (NULL, ‘Januzaj’), (NULL, ‘Smalling’), (NULL, ‘Lindegaard’), (NULL, ‘Hernandez’), (NULL, ‘Carrick’), (NULL, ‘Herrera’), (NULL, ‘Henriquez’), (NULL, ‘Valencia’);

Step2: Creating view file index.php for auto suggestion(You can give any name)

Step 3: Create style.css

Step 4: Now create autosuggestion.js file

Step 5: Create search.php for ajax request

 

(Visited 50 times, 1 visits today)

Leave a Comment.