{"id":662,"date":"2013-11-13T00:29:05","date_gmt":"2013-11-13T07:29:05","guid":{"rendered":"http:\/\/behstant.com\/blog\/?p=662"},"modified":"2016-03-23T13:20:22","modified_gmt":"2016-03-23T20:20:22","slug":"using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap","status":"publish","type":"post","link":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/","title":{"rendered":"Ajax usage to search a Record with PHP, MySQL and jQuery"},"content":{"rendered":"<p style=\"text-align: left;\">I have created a few post about how to Search, Update and Delete data from a MySQL Database with PHP and PDO. Those tutorials are quite simple (but not dynamically enough, they don&#8217;t use Ajax), but they are very important to catch the flow of this tutorial if you have never worked with this technologies. The tutorials are in Spanish so if you really need them in English I will be glad to translate them.<\/p>\n<p>Something that I would like to remark is that you can get the scripts at the end of the tutorial.<\/p>\n<p>In order to create a nice look and feel to the page I have implemented the framework Boostrap, but if you don&#8217;t want to focus on the look and feel you only have to focus on the Form, the event to Fire the Ajax request and the server to process your request.<\/p>\n<p>The next flow chart will show the path that we are going to cover to complete our Ajax search:<br \/>\n<!--more--><\/p>\n<figure id=\"attachment_665\" aria-describedby=\"caption-attachment-665\" style=\"width: 282px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/ajax_search.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-665 size-medium\" title=\"Click to enlarge !\" src=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/ajax_search-292x300.png\" alt=\"Ajax flow chart. Click to enlarge !\" width=\"292\" height=\"300\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/ajax_search-292x300.png 292w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/ajax_search.png 503w\" sizes=\"auto, (max-width: 292px) 100vw, 292px\" \/><\/a><figcaption id=\"caption-attachment-665\" class=\"wp-caption-text\">Ajax flow chart.<\/figcaption><\/figure>\n<h3>The HTML form<\/h3>\n<p>So the first thing that we must have is our form. Our form will contain a Label, Input, and a Button. We are not going to create a submit button because in order to add a nice style we need to use the button tag instead. The events Submit of the form and Click will be handle by jQuery.<\/p>\n<pre class=\"brush: html; gutter: true\">&lt;form method=&quot;get&quot;&gt;\t\r\n\t&lt;label for=&quot;name&quot;&gt;Name&lt;\/label&gt;\r\n\t&lt;input id=&quot;name&quot; name=&quot;name&quot; placeholder=&quot;Type the name&quot; \/&gt;\r\n\t&lt;button class=&quot;btnSearch&quot;&gt;Search&lt;\/button&gt;\t\r\n&lt;\/form&gt;<\/pre>\n<p>So this code will bring us the following form:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/026.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-671\" title=\"026\" src=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/026.png\" alt=\"\" width=\"564\" height=\"40\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/026.png 783w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/026-300x21.png 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/a><\/p>\n<p>You will see that form in the picture looks nice, this is achieve by implementing the classes from Bootstrap, but in order to keep the a clean code in the tutorial I will avoid putting all the styles in the code, you can have access to all this in the source files that I will place down.<\/p>\n<h3>Adding jQuery Library<\/h3>\n<p>I will put the jQuery library at the bottom of the page. You can put it on the head tag since this is not a page with loaded content. Usually you use it at the bottom of the page when you want the page to load smoothly.<\/p>\n<figure id=\"attachment_674\" aria-describedby=\"caption-attachment-674\" style=\"width: 490px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/028.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-674 size-full\" title=\"028\" src=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/028.png\" alt=\"jQuery Library to use Ajax.\" width=\"500\" height=\"97\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/028.png 500w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/028-300x58.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-674\" class=\"wp-caption-text\">jQuery Library to use Ajax.<\/figcaption><\/figure>\n<h3>The Actions<\/h3>\n<p>We are going to handle the events with two jQuery functions (Submit and Click), this events are trigger with the search button and when the form is submitted (Since we don&#8217;t have a \u00a0submit button the form will be submitted when the user press the key Enter)<\/p>\n<pre class=\"brush: javascript; gutter: true\">$(&#039;.btnSearch&#039;).click(function(){\r\n    \/\/ code goes here !\r\n});\r\n\r\n$(&#039;form&#039;).submit(function(e){\r\n    \/\/ code goes here !\r\n});<\/pre>\n<h3>The Ajax Request<\/h3>\n<p>Since we are going to make the Ajax request either on the Submit or Click\u00a0event we have to reduce our code by creating a function. This function will handle the request for both events.<\/p>\n<pre class=\"brush: javascript; gutter: true\">function makeAjaxRequest() {\r\n    $.ajax({\r\n        url: &#039;php\/search.php&#039;,\r\n        type: &#039;get&#039;,\r\n        data: {name: $(&#039;input#name&#039;).val()},\r\n        success: function(response) {\r\n            $(&#039;table#resultTable tbody&#039;).html(response);\r\n        }\r\n    });\r\n}<\/pre>\n<p>It is important to notice that from the server we get a response which will be use to show the result in a Table. Initialy we will have a table like this:<\/p>\n<figure id=\"attachment_682\" aria-describedby=\"caption-attachment-682\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/030.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-682\" title=\"Click to enlarge !\" src=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/030.png\" alt=\"Ajax results on this Table. Click to enlarge !\" width=\"560\" height=\"178\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/030.png 700w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/030-300x95.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><figcaption id=\"caption-attachment-682\" class=\"wp-caption-text\">Ajax results on this Table.<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>The structure of our table is:<\/p>\n<pre class=\"brush: html; gutter: true\">&lt;table id=&quot;resultTable&quot;&gt;\r\n    &lt;thead&gt;\r\n        &lt;tr&gt;\r\n            &lt;th&gt;Id&lt;\/th&gt;\r\n            &lt;th&gt;Name&lt;\/th&gt;\r\n            &lt;th&gt;Email&lt;\/th&gt;\r\n            &lt;th&gt;Telephone&lt;\/th&gt;\r\n        &lt;\/tr&gt;\r\n    &lt;\/thead&gt;\r\n    &lt;tbody&gt;&lt;\/tbody&gt;\r\n&lt;\/table&gt;<\/pre>\n<p>As you can see I left the tag &lt;tbody&gt; empty, this tag will be filled with jQuery, so to review the jQuery Ajax properties this is a simplyfied explanation:<\/p>\n<div class=\"quote\">\n<p><strong>url:<\/strong> Is the path where we are sending the data.<\/p>\n<p><strong>type:<\/strong> How are we sending the data, post\/get?<\/p>\n<p><strong>data:<\/strong> The data to be send in a query string format or JSON which is our case.<\/p>\n<p><strong>success:<\/strong> A callback function to be executed is the request was succesful. A &#8216;response&#8217; variable will be returned.<\/p>\n<p>Because I left the tag &lt;tbody&gt; with no data it will be fill with &#8216;response&#8217;. To achieve this we us jQuery html() method to add HTML code to this matched selector. The body of &lt;tbody&gt; will be a table structure created by the server. After we fill the table it will look like this:<\/p>\n<\/div>\n<figure id=\"attachment_689\" aria-describedby=\"caption-attachment-689\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/029.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-689\" title=\"Click to enlarge !\" src=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/029.png\" alt=\"Results loaded via Ajax. Click to enlarge !\" width=\"560\" height=\"178\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/029.png 700w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/029-300x95.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><figcaption id=\"caption-attachment-689\" class=\"wp-caption-text\">Results loaded via Ajax<\/figcaption><\/figure>\n<h3>Creation of Our Table (employee)<\/h3>\n<p>With this script we create and insert data into our table in MySQL:<\/p>\n<pre class=\"brush: sql; gutter: true\">CREATE TABLE IF NOT EXISTS `employee` (\r\n  `employee_id` int(11) NOT NULL AUTO_INCREMENT,\r\n  `name` varchar(85) NOT NULL,\r\n  `email` varchar(45) NOT NULL,\r\n  `telephone` varchar(20) NOT NULL,\r\n  PRIMARY KEY (`employee_id`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;\r\n\r\nINSERT INTO `employee` (`employee_id`, `name`, `email`, `telephone`) VALUES\r\n(1, &#039;Dennis Ritchie&#039;, &#039;dritchie@bell.com&#039;, &#039;555-154-8745&#039;),\r\n(2, &#039;Ken Thompson&#039;, &#039;kthompson@bell.com&#039;, &#039;555-154-1234&#039;),\r\n(3, &#039;Steve Jobs&#039;, &#039;sjobs@apple.com&#039;, &#039;751-121-8124&#039;);<\/pre>\n<h3>Server Side &#8216;search.php&#8217; (PHP)<\/h3>\n<p>Now in our server side we have to do a few steps to get our Information:<\/p>\n<ol>\n<li>Create a Database Connection to MySQL with PDO.<\/li>\n<li>Verify that the information is coming from a GET request.<\/li>\n<li>Create the Query.<\/li>\n<li>Prepare the query with the parameters.<\/li>\n<li>Bind and Execute the Query.<\/li>\n<li>Fetch all the records.<\/li>\n<li>Validate results.<\/li>\n<li>If there are results create the structure of a HTML table to fill the &lt;tbody&gt; in the client side.<\/li>\n<\/ol>\n<p>So the code that execute all the steps is:<\/p>\n<pre class=\"brush: php; gutter: true\">require_once &#039;Connection.simple.php&#039;;\r\n$conn = dbConnect();\r\nif (isset($_GET[&#039;name&#039;])) {\r\n    $data = &quot;%&quot;.$_GET[&#039;name&#039;].&quot;%&quot;;\r\n    $sql = &#039;SELECT * FROM employee WHERE name like ?&#039;;\r\n    $stmt = $conn-&gt;prepare($sql);\r\n    $results = $stmt-&gt;execute(array($data));\r\n    $rows = $stmt-&gt;fetchAll();\r\n}\r\nif(empty($rows)) {\r\n    echo &quot;&lt;tr&gt;&quot;;\r\n        echo &quot;&lt;td colspan=&#039;4&#039;&gt;There were not records&lt;\/td&gt;&quot;;\r\n    echo &quot;&lt;\/tr&gt;&quot;;\r\n}\r\nelse {\r\n    foreach ($rows as $row) {\r\n        echo &quot;&lt;tr&gt;&quot;;\r\n            echo &quot;&lt;td&gt;&quot;.$row[&#039;employee_id&#039;].&quot;&lt;\/td&gt;&quot;;\r\n            echo &quot;&lt;td&gt;&quot;.$row[&#039;name&#039;].&quot;&lt;\/td&gt;&quot;;\r\n            echo &quot;&lt;td&gt;&quot;.$row[&#039;email&#039;].&quot;&lt;\/td&gt;&quot;;\r\n            echo &quot;&lt;td&gt;&quot;.$row[&#039;telephone&#039;].&quot;&lt;\/td&gt;&quot;;\r\n        echo &quot;&lt;\/tr&gt;&quot;;\r\n    }\r\n}<\/pre>\n<p>With all these steps we can get our nice jQuery Ajax Search Application, at the end we add a nice touch to our application with Bootstrap to make it look more professional.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-694\" title=\"Click to enlarge !\" src=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png\" alt=\"Click to enlarge !\" width=\"604\" height=\"446\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png 1007w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031-300x221.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/p>\n<div><\/div>\n<div><\/div>\n<div>\n<h3>Buy\u00a0the full code with full code explanation(Recommended for beginners)<\/h3>\n\t<form id=\"edd_purchase_925\" class=\"edd_download_purchase_form edd_purchase_925\" method=\"post\">\n\n\t\t\t<div class=\"edd_price_options edd_single_mode\" >\n\t\t<ul>\n\t\t\t<li id=\"edd_price_option_925_supportthedeveloper\"><label for=\"edd_price_option_925_1\"><input type=\"radio\"  checked='checked' name=\"edd_options[price_id][]\" id=\"edd_price_option_925_1\" class=\"edd_price_option_925\" value=\"1\" data-price=\"9.99\"\/>&nbsp;<span class=\"edd_price_option_name\">Support the Developer<\/span><span class=\"edd_price_option_sep\">&nbsp;&ndash;&nbsp;<\/span><span class=\"edd_price_option_price\">&#36;9.99<\/span><\/label><\/li><li id=\"edd_price_option_925_feelinggrateful\"><label for=\"edd_price_option_925_2\"><input type=\"radio\"  name=\"edd_options[price_id][]\" id=\"edd_price_option_925_2\" class=\"edd_price_option_925\" value=\"2\" data-price=\"4.99\"\/>&nbsp;<span class=\"edd_price_option_name\">Feeling Grateful<\/span><span class=\"edd_price_option_sep\">&nbsp;&ndash;&nbsp;<\/span><span class=\"edd_price_option_price\">&#36;4.99<\/span><\/label><\/li><li id=\"edd_price_option_925_justthecode\"><label for=\"edd_price_option_925_3\"><input type=\"radio\"  name=\"edd_options[price_id][]\" id=\"edd_price_option_925_3\" class=\"edd_price_option_925\" value=\"3\" data-price=\"2.99\"\/>&nbsp;<span class=\"edd_price_option_name\">Just the Code<\/span><span class=\"edd_price_option_sep\">&nbsp;&ndash;&nbsp;<\/span><span class=\"edd_price_option_price\">&#36;2.99<\/span><\/label><\/li>\t\t<\/ul>\n\t<\/div><!--end .edd_price_options-->\n\t\n\t\t<div class=\"edd_purchase_submit_wrapper\">\n\t\t\t<button class=\"edd-add-to-cart button-cart edd-submit\" data-nonce=\"b087504f6d\" data-timestamp=\"1780622558\" data-token=\"bba9bbe6ab828c29cddadd20d7566f8614109938cf3fe53aecd681bf53da143e\" data-action=\"edd_add_to_cart\" data-download-id=\"925\"  data-variable-price=\"yes\" data-price-mode=single data-price=\"0.00\" ><span class=\"edd-add-to-cart-label\">(Paypal) Download the Commented Code<\/span> <span class=\"edd-loading\" aria-label=\"Loading\"><\/span><\/button><input type=\"submit\" class=\"edd-add-to-cart edd-no-js button-cart edd-submit\" name=\"edd_purchase_download\" value=\"(Paypal) Download the Commented Code\" data-action=\"edd_add_to_cart\" data-download-id=\"925\"  data-variable-price=\"yes\" data-price-mode=single \/><a href=\"http:\/\/behstant.com\/blog\/checkout\/\" class=\"edd_go_to_checkout button-cart edd-submit\" style=\"display:none;\">Checkout<\/a>\n\t\t\t\t\t\t\t<span class=\"edd-cart-ajax-alert\" aria-live=\"assertive\">\n\t\t\t\t\t<span class=\"edd-cart-added-alert\" style=\"display: none;\">\n\t\t\t\t\t\t<svg class=\"edd-icon edd-icon-check\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"28\" height=\"28\" viewBox=\"0 0 28 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<path d=\"M26.11 8.844c0 .39-.157.78-.44 1.062L12.234 23.344c-.28.28-.672.438-1.062.438s-.78-.156-1.06-.438l-7.782-7.78c-.28-.282-.438-.673-.438-1.063s.156-.78.438-1.06l2.125-2.126c.28-.28.672-.438 1.062-.438s.78.156 1.062.438l4.594 4.61L21.42 5.656c.282-.28.673-.438 1.063-.438s.78.155 1.062.437l2.125 2.125c.28.28.438.672.438 1.062z\"\/>\n\t\t\t\t\t\t<\/svg>\n\t\t\t\t\t\tAdded to cart\t\t\t\t\t<\/span>\n\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><!--end .edd_purchase_submit_wrapper-->\n\n\t\t<input type=\"hidden\" name=\"download_id\" value=\"925\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"edd_action\" class=\"edd_action_input\" value=\"add_to_cart\">\n\t\t\n\t\t\n\t\t\n\t<\/form><!--end #edd_purchase_925-->\n\t\n<\/div>\n<div id=\"download_code\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I have created a few post about how to Search, Update and Delete data from a MySQL Database with PHP and PDO. Those tutorials are quite simple (but not dynamically enough, they don&#8217;t use Ajax), but they are very important to catch the flow of this tutorial if you have never worked with this technologies. &#8230; <a title=\"Ajax usage to search a Record with PHP, MySQL and jQuery\" class=\"read-more\" href=\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\" aria-label=\"Read more about Ajax usage to search a Record with PHP, MySQL and jQuery\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":694,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[25],"tags":[58,68,43,67,62,69],"class_list":["post-662","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery","tag-ajax","tag-database","tag-javascript-2","tag-jquery","tag-php","tag-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ajax usage to Search a Record with PHP, MySQL and jQuery<\/title>\n<meta name=\"description\" content=\"On this article you&#039;ll learn to find a record on your MySQL database dynamically by using jQuery, Ajax and PHP. Uses Bootstrap to give a nice look and feel.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ajax usage to Search a Record with PHP, MySQL and jQuery\" \/>\n<meta property=\"og:description\" content=\"On this article you&#039;ll learn to find a record on your MySQL database dynamically by using jQuery, Ajax and PHP. Uses Bootstrap to give a nice look and feel.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\" \/>\n<meta property=\"og:site_name\" content=\"The Code\" \/>\n<meta property=\"article:published_time\" content=\"2013-11-13T07:29:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-23T20:20:22+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1007\" \/>\n\t<meta property=\"og:image:height\" content=\"744\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Reedyseth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Reedyseth\" \/>\n<meta name=\"twitter:site\" content=\"@Reedyseth\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reedyseth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\"},\"author\":{\"name\":\"Reedyseth\",\"@id\":\"https:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\"},\"headline\":\"Ajax usage to search a Record with PHP, MySQL and jQuery\",\"datePublished\":\"2013-11-13T07:29:05+00:00\",\"dateModified\":\"2016-03-23T20:20:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\"},\"wordCount\":834,\"commentCount\":171,\"image\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png\",\"keywords\":[\"Ajax\",\"Database\",\"Javascript\",\"jQuery\",\"PHP\",\"Tutorials\"],\"articleSection\":[\"jQuery\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\",\"url\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\",\"name\":\"Ajax usage to Search a Record with PHP, MySQL and jQuery\",\"isPartOf\":{\"@id\":\"https:\/\/behstant.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png\",\"datePublished\":\"2013-11-13T07:29:05+00:00\",\"dateModified\":\"2016-03-23T20:20:22+00:00\",\"author\":{\"@id\":\"https:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\"},\"description\":\"On this article you'll learn to find a record on your MySQL database dynamically by using jQuery, Ajax and PHP. Uses Bootstrap to give a nice look and feel.\",\"breadcrumb\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage\",\"url\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png\",\"contentUrl\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png\",\"width\":\"1007\",\"height\":\"744\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/behstant.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ajax usage to search a Record with PHP, MySQL and jQuery\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/behstant.com\/blog\/#website\",\"url\":\"https:\/\/behstant.com\/blog\/\",\"name\":\"The Code\",\"description\":\"Learn Web Solutions in WordPress, PHP, jand also purchase code solutions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/behstant.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\",\"name\":\"Reedyseth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"caption\":\"Reedyseth\"},\"description\":\"My Google Profile+\",\"sameAs\":[\"http:\/\/behstant.com\"],\"url\":\"http:\/\/behstant.com\/blog\/author\/reedyseth\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ajax usage to Search a Record with PHP, MySQL and jQuery","description":"On this article you'll learn to find a record on your MySQL database dynamically by using jQuery, Ajax and PHP. Uses Bootstrap to give a nice look and feel.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/","og_locale":"en_US","og_type":"article","og_title":"Ajax usage to Search a Record with PHP, MySQL and jQuery","og_description":"On this article you'll learn to find a record on your MySQL database dynamically by using jQuery, Ajax and PHP. Uses Bootstrap to give a nice look and feel.","og_url":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/","og_site_name":"The Code","article_published_time":"2013-11-13T07:29:05+00:00","article_modified_time":"2016-03-23T20:20:22+00:00","og_image":[{"width":1007,"height":744,"url":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png","type":"image\/png"}],"author":"Reedyseth","twitter_card":"summary_large_image","twitter_creator":"@Reedyseth","twitter_site":"@Reedyseth","twitter_misc":{"Written by":"Reedyseth","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#article","isPartOf":{"@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/"},"author":{"name":"Reedyseth","@id":"https:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f"},"headline":"Ajax usage to search a Record with PHP, MySQL and jQuery","datePublished":"2013-11-13T07:29:05+00:00","dateModified":"2016-03-23T20:20:22+00:00","mainEntityOfPage":{"@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/"},"wordCount":834,"commentCount":171,"image":{"@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage"},"thumbnailUrl":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png","keywords":["Ajax","Database","Javascript","jQuery","PHP","Tutorials"],"articleSection":["jQuery"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/","url":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/","name":"Ajax usage to Search a Record with PHP, MySQL and jQuery","isPartOf":{"@id":"https:\/\/behstant.com\/blog\/#website"},"primaryImageOfPage":{"@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage"},"image":{"@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage"},"thumbnailUrl":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png","datePublished":"2013-11-13T07:29:05+00:00","dateModified":"2016-03-23T20:20:22+00:00","author":{"@id":"https:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f"},"description":"On this article you'll learn to find a record on your MySQL database dynamically by using jQuery, Ajax and PHP. Uses Bootstrap to give a nice look and feel.","breadcrumb":{"@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#primaryimage","url":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png","contentUrl":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2013\/11\/031.png","width":"1007","height":"744"},{"@type":"BreadcrumbList","@id":"http:\/\/behstant.com\/blog\/jquery\/using-ajax-to-search-a-record-with-php-mysql-and-jquery-look-and-feel-by-bootstrap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/behstant.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ajax usage to search a Record with PHP, MySQL and jQuery"}]},{"@type":"WebSite","@id":"https:\/\/behstant.com\/blog\/#website","url":"https:\/\/behstant.com\/blog\/","name":"The Code","description":"Learn Web Solutions in WordPress, PHP, jand also purchase code solutions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/behstant.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f","name":"Reedyseth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","caption":"Reedyseth"},"description":"My Google Profile+","sameAs":["http:\/\/behstant.com"],"url":"http:\/\/behstant.com\/blog\/author\/reedyseth\/"}]}},"_links":{"self":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts\/662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/comments?post=662"}],"version-history":[{"count":0,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts\/662\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/media\/694"}],"wp:attachment":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/media?parent=662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/categories?post=662"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/tags?post=662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}