<?php /******************************************************************************** * Website: www.nesswatson.blogspot.in * Email: nesswtsn90@gmail.com or www.nesswatson.blogspot.in * Please, do not remove this information from the top of this code. * Thank You! *********************************************************************************/  include "config.php"; // Include the database connection file  if(isset($_POST['item']) && !empty($_POST['item']))  // Page validation against empty field { 	// This is the item to search for in the database 	$this_item = trim(strip_tags($_POST['item'])); 	 	if($this_item == "") // Be sure that this item is not empty before proceeding 	{ 		//Display an error message when the item brought is an empty field 		echo '<div class="un_suggested_items">There was no data passed</div>'; 	} 	else 	{ 		// Otherwise, check for that item when it is not empty in the database 		$check_item = mysql_query("select * from `auto_suggest_system_countries` where `country` like '%".mysql_real_escape_string($this_item)."%' order by `country` asc limit 12"); 		if(mysql_num_rows($check_item) > 0) // If the result brought from the database is greater than zero then proceed okay 		{ 			//Display the suggested countries 			echo '<div class="suggested_items_wrapper" align="left">'; 			 			while ($get_item = mysql_fetch_array($check_item))  			{ 				$vpb_countries = trim(strip_tags($get_item["country"])); 				echo '<div class="suggested_items" onClick="vpb_selected_item(\''.addslashes($vpb_countries).'\');">'.$vpb_countries.'</div>'; 			} 			 			echo '</div>'; 		}  		else  		{ 			//Otherwise, show an error message when there is no matching word for the searched item in the database 			echo '<div class="un_suggested_items">Sorry, there was no result found.</div>'; 		} 	} }  ?>