A useful feature, and high “value add” to many sites today is a text box with autocomplete and suggestion as you type. The powerful jQuery JavaScript library makes this really easy to do, especially with the help of the excellent autocomplete plugin from bassistance.de. In this example we will setup a page to search for people, with a text box, a hidden field to hold the ID of our selected person, and a submit button. The setup is pretty simple. Let’s take a look at that code.
From here we need a little JavaScript magic to wire up our autocomplete. There are three items of concern. The first is just setting up the autocomplete on the text box. The next item is to make sure that when a selection is made our hidden field (which contains the person’s ID) is populated. The final area of concern is if the user blanks out the text box value, we want to reset our hidden field. Let’s look at the first part where we setup the autocomplete.
/*
* Initialize the autocomplete. Will call ajax_searchPersons.cfm
* and pass the variable "q" as the query.
*/
$("#searchPersonText").autocomplete("ajax_searchPersons.cfm", {
width: 300,
multiple: false,
formatItem: function(row) {
return row[1];
},
formatResult: function(row) {
return row[1];
}
});
In that snippet we are telling the autocomplete control that it will retrieve its data from a ColdFusion page called “ajax_searchPersons.cfm”. Aside from a couple of basic configuration options, there are two options worth noting in detail. The first is the formatItem value. This configuration parameter takes a function, and is passed an array containing the key, and the value returned from the AJAX call. This is called to display the suggestion box. The next is the formatResult value. This function takes the same parameter, and dictates what displays in the text box when an item is selected.
Now we need to populate our hidden field once a selection is made. This is done by calling the result method against our text box. It takes a function as an argument, with three parameters: event, data, and formatted text. The data argument is what we are interested in. Again this argument is an array with two values, the key, and the value. Let’s look at that.
/*
* When an item is selected from the autocomplete
* dropdown, set the selected ID into the hidden field.
*/
$("#searchPersonText").result(function(e, data, formatted) {
$("#personId").val(data[0]);
});
And finally we want to make sure that if the user blanks out the text box we reset the hidden field’s value to zero. To do this we will handle the onblur event. In this handler we’ll check the text box for a blank value. If it is blank, we will zero out the hidden field. Here is that code.
/*
* When we blur off the text box we want to make sure
* something is selected. If we've cleared it out zero
* out the hidden field.
*/
$("#searchPersonText").blur(function(e) {
if ($("#searchPersonText").val() === "") {
$("#personId").val("0");
}
});
Now let’s talk about the server side. The bassistance.de autocomplete plugin will pass a URL variable called “q” to a server side page, and expects a set of records delimited by a carriage return. Each record must have a key and value, delimited by a pipe. So, for example, if my ID is 1, and my name is “Adam Presley”, I will send back a record like this (without quotes): “1|Adam Presley”. This will be followed by a new line.
I have a sample database with a table called “persons”, and I’ve populated it with sample data (provided below). This page will query that table for any records where the first name plus last name is like the search string passed in by the autocomplete JavaScript. We will then craft the pipe delimited records and spit it out onto the page. Here’s that code now.
<cfsetting enablecfoutputonly="true" showdebugoutput="false" /><cfsilent>
<cfset local = structNew() />
<cfquery name="qryPersons" datasource="dsn">
SELECT
p.id
, p.firstName
, p.lastName
FROM persons AS p
WHERE
(CONCAT(p.firstName, ' ', p.lastName) LIKE <cfqueryparam value="%#url.q#%" cfsqltype="cf_sql_varchar" />)
</cfquery>
<cfset local.output = "" />
<cfset local.crlf = "#chr(13)##chr(10)#" />
<!---
This jQuery plugin requires the data to come back formatted like:
key|value\n
--->
<cfloop query="qryPersons">
<cfset local.output = local.output & "#qryPersons.id#|#qryPersons.firstName# #qryPersons.lastName##local.crlf#" />
</cfloop>
</cfsilent><cfoutput>#local.output#</cfoutput>
As you can see this plugin is pretty easy to use, and powerful too. The code for all of this is below. Happy coding!
index.cfm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jQuery Autocomplete Example</title>
<link type="text/css" rel="stylesheet" href="jquery-autocomplete/jquery.autocomplete.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery-autocomplete/jquery.autocomplete.min.js"></script>
</head>
<body>
<cfif structKeyExists(form, "btnSubmit")>
<p>
<cfoutput>You searched for #form.searchPersonText# and found ID #form.personId#</cfoutput>
</p>
</cfif>
<p>
Please type in the name of the person you are searching for.
For example, try typing "sel", or "ja".
</p>
<form name="frmSearch" id="frmSearch" method="post">
<input type="text" id="searchPersonText" name="searchPersonText" value="" />
<input type="hidden" id="personId" name="personId" value="0" />
<input type="submit" name="btnSubmit" id="btnSubmit" value="Submit" />
</form>
<script type="text/javascript">
$(function() {
var ExamplePage = function() {
this.initialize = function() {
/*
* Initialize the autocomplete. Will call ajax_searchPersons.cfm
* and pass the variable "q" as the query.
*/
$("#searchPersonText").autocomplete("ajax_searchPersons.cfm", {
width: 300,
multiple: false,
formatItem: function(row) {
return row[1];
},
formatResult: function(row) {
return row[1];
}
});
/*
* When an item is selected from the autocomplete
* dropdown, set the selected ID into the hidden field.
*/
$("#searchPersonText").result(function(e, data, formatted) {
$("#personId").val(data[0]);
});
/*
* When we blur off the text box we want to make sure
* something is selected. If we've cleared it out zero
* out the hidden field.
*/
$("#searchPersonText").blur(function(e) {
if ($("#searchPersonText").val() === "") {
$("#personId").val("0");
}
});
$("#searchPersonText").focus();
};
this.initialize();
}();
});
</script>
</body>
</html>
ajax_searchPersons.cfm
<cfsetting enablecfoutputonly="true" showdebugoutput="false" /><cfsilent>
<cfset local = structNew() />
<cfquery name="qryPersons" datasource="mysqlcf_cfexamples">
SELECT
p.id
, p.firstName
, p.lastName
FROM persons AS p
WHERE
(CONCAT(p.firstName, ' ', p.lastName) LIKE <cfqueryparam value="%#url.q#%" cfsqltype="cf_sql_varchar" />)
</cfquery>
<cfset local.output = "" />
<cfset local.crlf = "#chr(13)##chr(10)#" />
<!---
This jQuery plugin requires the data to come back formatted like:
key|value\n
--->
<cfloop query="qryPersons">
<cfset local.output = local.output & "#qryPersons.id#|#qryPersons.firstName# #qryPersons.lastName##local.crlf#" />
</cfloop>
</cfsilent><cfoutput>#local.output#</cfoutput>
SQL Data
CREATE TABLE persons (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`personId` MEDIUMINT default NULL,
`firstName` varchar(255) default NULL,
`lastName` varchar(255) default NULL,
`email` varchar(255) default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1;
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('1','Imogene','Coffey','nec.tempus.scelerisque@montesnascetur.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('2','Marsden','Mcbride','malesuada.malesuada.Integer@vitae.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('3','Jescie','Vang','neque.venenatis@ipsum.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('4','August','Hewitt','Nullam@MorbimetusVivamus.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('5','Raven','Gilmore','Sed@mollisInteger.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('6','Susan','Reyes','Proin.vel@Duiscursus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('7','Maya','Soto','massa@bibendumDonecfelis.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('8','Wyatt','Nixon','Fusce.dolor.quam@Cum.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('9','Alfonso','Ochoa','nunc.In@nec.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('10','Kim','Price','massa.Mauris.vestibulum@Morbimetus.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('11','Selma','Wilder','nec@SeddictumProin.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('12','Luke','Maddox','Donec.porttitor@a.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('13','Fatima','Ramos','dui.semper@etrisus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('14','Ivory','Lynch','dui@amet.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('15','Rebekah','Duke','id.libero@magna.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('16','Anjolie','Lester','placerat.orci.lacus@sem.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('17','Farrah','Mcmillan','venenatis.vel.faucibus@lobortisClass.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('18','Randall','Carrillo','posuere@egetvolutpatornare.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('19','Zane','Curtis','placerat.eget@elementumat.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('20','Nelle','Hunt','erat.eget@ornarelectusjusto.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('21','Aurora','Joyner','est.Mauris@id.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('22','Ivana','Rivera','luctus.et.ultrices@Donecfeugiatmetus.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('23','Macy','Hopkins','Donec.non.justo@acrisus.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('24','Brooke','Hart','a.feugiat.tellus@euodiotristique.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('25','Shaeleigh','Montgomery','ac@amet.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('26','Coby','Coffey','fermentum.metus@velarcueu.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('27','Sybill','Hunt','Fusce.mi@sapienNuncpulvinar.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('28','Kuame','Hawkins','nisl.Nulla@ornarelectusjusto.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('29','Martena','Monroe','est@odio.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('30','Harper','Rodriguez','dictum.magna.Ut@Fuscealiquetmagna.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('31','Valentine','Hebert','risus@temporestac.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('32','Quamar','Lindsay','nunc.sed@Aliquamtinciduntnunc.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('33','Olivia','Daniels','nulla.Integer@euduiCum.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('34','Brenden','Reeves','vehicula@etarcu.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('35','Kareem','Booker','vel.est@sagittisfelis.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('36','Giacomo','Wise','magna.Sed@feugiatLorem.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('37','Ivy','Tucker','at.augue@Aliquam.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('38','Yuri','Montgomery','erat.Sed@massalobortis.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('39','Vernon','Parsons','luctus.sit.amet@aliquameuaccumsan.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('40','Drew','Love','id@lobortisnisi.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('41','Amal','Oneal','est@duiCum.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('42','Oliver','Montgomery','pretium@Donec.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('43','Mechelle','Garcia','dictum.magna@sit.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('44','Ruby','Cline','non.arcu.Vivamus@famesacturpis.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('45','Dean','Riddle','libero.at@anteblandit.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('46','Andrew','Fox','eu.placerat@lacusvestibulumlorem.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('47','Clayton','Forbes','in@turpisIn.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('48','May','Sims','sodales.purus@quis.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('49','Phyllis','Kerr','sed@Phasellus.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('50','Odysseus','Holden','ligula@Sedeunibh.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('51','Minerva','Cooley','risus@rhoncusNullam.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('52','Brianna','Bentley','a@inaliquetlobortis.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('53','Virginia','Byrd','rhoncus.Donec.est@consequatdolor.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('54','Tana','Sykes','bibendum@arcu.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('55','Anthony','Mejia','cubilia.Curae;.Donec@euismodindolor.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('56','Fallon','Gamble','vel.arcu@idmagna.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('57','Emily','Dyer','dolor.egestas@ametornare.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('58','Ahmed','Hewitt','sem.semper@Praesent.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('59','Maisie','Peterson','commodo.auctor.velit@senectuset.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('60','Cally','Sexton','convallis@Mauris.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('61','Kevyn','Webster','neque@magna.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('62','Logan','Sykes','urna@pede.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('63','Macaulay','Ford','Cras@ac.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('64','Grady','Rose','enim.gravida@Mauriseu.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('65','Rashad','Rogers','et.magnis.dis@elementumpurusaccumsan.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('66','Wing','Mcdonald','Mauris@vehiculaPellentesque.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('67','Rebekah','Wallace','sollicitudin.orci.sem@elit.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('68','Derek','Owen','erat.eget@Fuscediam.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('69','Brenda','Goff','luctus@in.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('70','Stuart','Wise','Donec.elementum@metusAenean.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('71','Andrew','Walker','neque.non@pharetranibhAliquam.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('72','Blaine','Barker','lorem.auctor.quis@miloremvehicula.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('73','Cooper','Hughes','nec@arcuVestibulumante.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('74','Victoria','Craft','In.at@Nulla.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('75','Portia','Levine','mauris@idlibero.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('76','Gage','Vargas','vel.est.tempor@vulputateveliteu.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('77','Myra','Gaines','ipsum.nunc.id@etnuncQuisque.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('78','Lavinia','Cannon','sociis.natoque@elitpharetra.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('79','Kelsey','Sharpe','nisl.arcu.iaculis@tinciduntpede.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('80','Savannah','Nash','Maecenas.libero.est@loremsit.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('81','Kelsey','Justice','Fusce.fermentum@NullafacilisiSed.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('82','Leigh','Byrd','sem.molestie@ultrices.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('83','Lynn','Sears','ipsum@laoreetposuere.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('84','Alice','Atkinson','in.cursus@feugiatnecdiam.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('85','Desiree','Wise','a.mi@tristiquesenectus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('86','Dorothy','Farrell','blandit@arcuSed.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('87','Mira','Hawkins','nibh.Aliquam.ornare@In.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('88','Tana','Pearson','dapibus.gravida.Aliquam@risusvariusorci.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('89','Idola','Quinn','parturient.montes.nascetur@magnaseddui.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('90','Chester','Levine','dui.Fusce@egetmagnaSuspendisse.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('91','Conan','Cochran','et.commodo@orciPhasellus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('92','Roary','Roberson','velit.in@ultricessit.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('93','Cynthia','Walton','et.magnis@orciluctuset.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('94','Howard','Pacheco','lobortis.tellus.justo@Nunc.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('95','Amanda','Wells','Class.aptent@eget.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('96','Oleg','Sanford','nibh.vulputate@pharetrased.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('97','Axel','Jacobson','non.feugiat.nec@tacitisociosqu.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('98','Belle','Keller','Donec@metus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('99','Ian','Harvey','elementum@enimEtiam.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('100','Joshua','Goff','urna.suscipit.nonummy@elit.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('101','Phillip','Clarke','lorem.ut.aliquam@sagittisaugue.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('102','Ann','Briggs','eros@scelerisqueneque.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('103','Ramona','Johnson','lorem.semper.auctor@Sedetlibero.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('104','Dai','Maldonado','primis.in@egetdictumplacerat.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('105','Aristotle','Ingram','eu.sem.Pellentesque@Aliquamnisl.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('106','Elaine','Leonard','dui.semper.et@idenim.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('107','Cruz','Flynn','Curabitur@vulputateposuerevulputate.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('108','Maryam','Townsend','risus.a.ultricies@eudolor.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('109','Gregory','Kelley','vestibulum.neque@aptenttacitisociosqu.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('110','Lila','Weaver','tempor.lorem.eget@acorci.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('111','Brady','Mendez','ac.libero.nec@egetmollislectus.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('112','Naomi','Schneider','rhoncus.Nullam@semegetmassa.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('113','Charlotte','Moses','turpis.nec.mauris@malesuada.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('114','Benedict','Mueller','rhoncus@tempordiam.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('115','Azalia','Sheppard','semper.auctor.Mauris@Nullamenim.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('116','Hadassah','Hobbs','dapibus.quam.quis@sed.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('117','Yasir','Sheppard','at.sem@purusDuis.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('118','Maite','Singleton','in.faucibus.orci@miac.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('119','Blaine','Bennett','Nulla@eusemPellentesque.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('120','Grace','Graham','luctus.et.ultrices@risusatfringilla.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('121','Alice','Dillon','Integer@velit.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('122','Lane','Everett','lobortis.risus.In@hendrerit.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('123','Maggie','Lamb','Curae;.Donec@aliquetdiam.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('124','Jermaine','Cline','ut@semconsequat.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('125','Fiona','Bean','lorem.ac@sed.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('126','Hamilton','Grimes','non.lobortis@Integerin.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('127','Quentin','Acosta','est@utodio.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('128','Basia','Russell','Vestibulum@Seddiamlorem.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('129','Kato','Mcmillan','non.quam.Pellentesque@disparturient.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('130','William','Stone','mus.Proin@non.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('131','Tad','Klein','eget.magna@Cumsociis.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('132','Alec','Welch','odio@necurnasuscipit.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('133','Patrick','Mccormick','ut@Phasellus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('134','Shoshana','Harmon','a@ultrices.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('135','Kameko','Weeks','velit.Sed@semegestas.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('136','Xavier','Haley','eget@perconubia.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('137','Beau','Juarez','iaculis.lacus.pede@Phasellus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('138','Diana','Walls','dolor@sagittis.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('139','Lester','Hays','nunc@etrutrum.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('140','Ruby','Griffin','Etiam.laoreet@etmagnisdis.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('141','Aubrey','Tyson','consequat.purus.Maecenas@penatibuset.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('142','Jasper','Maddox','Donec@ligulaconsectetuer.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('143','Russell','Stevens','leo.Cras.vehicula@volutpat.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('144','Mannix','Guzman','porttitor@nonmagnaNam.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('145','Jerry','Daniels','blandit@id.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('146','Keiko','Mccoy','Lorem.ipsum.dolor@habitant.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('147','Marah','Cole','purus.Duis@egestas.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('148','Galvin','Downs','odio.auctor@Crasvehicula.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('149','Graiden','Workman','augue.eu.tempor@velit.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('150','Gemma','Mcintosh','tincidunt@morbi.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('151','Forrest','Osborn','a.arcu@risusInmi.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('152','Violet','Mccormick','risus@tortorNunccommodo.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('153','James','Briggs','eleifend.egestas.Sed@sodales.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('154','Erich','Barber','ridiculus@ataugue.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('155','Roth','Austin','cursus.a@lacusQuisquepurus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('156','Lev','Dalton','mauris.sagittis@felisegetvarius.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('157','Maris','Kramer','Nunc@scelerisquedui.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('158','Nina','Bowers','nec.urna@Aenean.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('159','Phyllis','Scott','Donec@interdumligulaeu.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('160','Lacy','Mcleod','Duis.gravida.Praesent@Vivamuseuismodurna.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('161','Maite','Cline','In.faucibus@uterosnon.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('162','Eve','Frazier','lacus@variuset.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('163','Kasper','Lott','vehicula.Pellentesque.tincidunt@Aliquamerat.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('164','Cora','Hutchinson','et.tristique@neque.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('165','Tara','Pugh','Quisque.fringilla@elementumsemvitae.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('166','Macy','Peters','velit@tortor.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('167','Imani','Guerrero','ac.feugiat.non@bibendumfermentummetus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('168','Echo','Leonard','eu@sapienCrasdolor.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('169','Aretha','Austin','mauris@pedeetrisus.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('170','Nathaniel','Barnett','condimentum@purusDuiselementum.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('171','Rebekah','Wallace','Mauris@Duis.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('172','Colorado','Santos','tellus.Suspendisse@quisaccumsan.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('173','Garrison','Brady','egestas@rutrum.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('174','Tallulah','Holland','id.ante.Nunc@nonlorem.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('175','Dalton','Mccray','vestibulum@montesnascetur.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('176','Sage','Keller','a.scelerisque@a.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('177','Maya','Dunlap','accumsan.interdum@netuset.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('178','Jemima','Hart','quam.a.felis@Donecnonjusto.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('179','Erasmus','Pratt','mauris.sagittis.placerat@neque.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('180','Shannon','Franklin','Curabitur.vel.lectus@utmolestiein.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('181','Blake','Adkins','interdum@risus.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('182','Lysandra','Myers','nisi@ac.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('183','Sybill','Little','elit.dictum@Vestibulum.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('184','Linda','Cortez','nulla@nequeNullam.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('185','Faith','Ferguson','dolor.elit.pellentesque@ut.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('186','Kieran','Underwood','nulla.at.sem@pellentesqueSed.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('187','Madonna','Barnett','et.rutrum.eu@interdumenim.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('188','Shelley','Frederick','Sed.auctor@etmagnis.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('189','Alexis','Ratliff','consectetuer@volutpat.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('190','Ferris','Williamson','eros.Proin.ultrices@euismodetcommodo.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('191','Jameson','Aguilar','interdum@non.org');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('192','Madeson','Berger','tortor@musDonec.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('193','Tanner','Greer','dolor.dapibus.gravida@nunc.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('194','Callie','Puckett','dui@Aliquamgravidamauris.com');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('195','Lucius','Spears','Fusce.aliquet@montesnasceturridiculus.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('196','Troy','Miranda','dictum.ultricies.ligula@convallisdolorQuisque.edu');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('197','Athena','Patton','et.libero.Proin@consectetuer.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('198','Chase','Mullins','Quisque@aaliquet.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('199','Brenda','Cantu','faucibus@amet.ca');
INSERT INTO `persons` (`personId`,`firstName`,`lastName`,`email`) VALUES ('200','Steven','Castaneda','Etiam.laoreet.libero@orciconsectetuereuismod.com');