<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WebDesignerGeeks - Web Designer, Web Developer blog &#187; PHP</title>
	<atom:link href="http://webdesignergeeks.com/category/tutorials/php-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdesignergeeks.com</link>
	<description></description>
	<lastBuildDate>Mon, 25 Feb 2013 18:46:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Jquery autocomplete php mysql example</title>
		<link>http://webdesignergeeks.com/coding/jquery-autocomplete-php-mysql-example/</link>
		<comments>http://webdesignergeeks.com/coding/jquery-autocomplete-php-mysql-example/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 18:49:01 +0000</pubDate>
		<dc:creator>Ratan</dc:creator>
				<category><![CDATA[AJAX & CSS]]></category>
		<category><![CDATA[AJAX & JS]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Jquery autocomplete]]></category>

		<guid isPermaLink="false">http://webdesignergeeks.com/?p=5267</guid>
		<description><![CDATA[<p>After getting more and more request for Jquery autocomplete php mysql example from Create Ajax Search Using PHP MYSQL and jQuery tutorial,  Finally I have completed this last night. Jquery autocomplete php mysql example Lets start, In this tutorial we will us jQuery plugin: Autocomplete Autocomplete an input field to enable users quickly finding and selecting some value, leveraging searching and [...]</p><p>The post <a href="http://webdesignergeeks.com/coding/jquery-autocomplete-php-mysql-example/">Jquery autocomplete php mysql example</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>
Related posts:<ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/' rel='bookmark' title='How to Create Custom RSS Feed Using MySQL and PHP'>How to Create Custom RSS Feed Using MySQL and PHP</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/' rel='bookmark' title='Getting Start With CakePHP and jQuery'>Getting Start With CakePHP and jQuery</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After getting more and more request for <strong>Jquery autocomplete php mysql example</strong> from <a title="Create Ajax Search Using PHP MYSQL and jQuery" href="http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/" target="_blank">Create Ajax Search Using PHP MYSQL and jQuery</a> tutorial,  Finally I have completed this last night.</p>
<p><div id="attachment_5290" class="wp-caption alignnone" style="width: 470px"><a href="http://webdesignergeeks.com/wp-content/uploads/2012/12/Webdesignergeeks-jQuery-Autocomplete-DEMO.png"><img class="size-full wp-image-5290" title="Webdesignergeeks - jQuery Autocomplete DEMO" src="http://webdesignergeeks.com/wp-content/uploads/2012/12/Webdesignergeeks-jQuery-Autocomplete-DEMO.png" alt="jQuery Autocomplete Example Demo" width="460" height="316" /></a><p class="wp-caption-text">jQuery Autocomplete Example Demo</p></div><br />
Jquery autocomplete php mysql example<br />
<br/><br />
Lets start, In this tutorial we will us <a title="jQuery plugin: Autocomplete" href="http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/" target="_blank">jQuery plugin: Autocomplete</a></p>
<p>Autocomplete an input field to enable users quickly finding and selecting some value, leveraging searching and filtering.</p>
<p>By giving an autocompleted field focus or entering something into it, the plugin starts searching for matching entries and displays a list of values to choose from. By entering more characters, the user can filter down the list to better matches.</p>
<p>This can be used to enter previous selected values, eg. for tags, to complete an address, eg. enter a city name and get the zip code, or maybe enter email addresses from an addressbook.</p>
<h2><a title="jquery-autocomplete-php-mysql-example-demo" href="http://webdesignergeeks.com//tuts/Demo/jquery-autocomplete-php-mysql-example/demo/" target="_blank">DEMO</a> | <a title="jquery-autocomplete-php-mysql-example" href="http://webdesignergeeks.com/tuts/Download/jquery-autocomplete-php-mysql-example.zip" target="_blank">DOWNLAOD</a></h2>
<p>We will divide this tutorial in 4 step, so it will more easy to understand and create.</p>
<h3>STEP 1: Create Database</h3>
<p>First of we need to create country database, and will insert all country with id.<br />
You can simple import demo.sql file with this article zip file.</p>
<pre name="code" class="html">

CREATE TABLE IF NOT EXISTS `countries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(2) NOT NULL DEFAULT '',
  `name` varchar(200) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=247 ;
</pre>
<p>&nbsp;</p>
<h3>STEP  2:  Create config.php</h3>
<p>Now, we need to create db connection.</p>
<pre name="code" class="html">
<?php
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "root";
$mysql_database = "demo";
$prefix = "";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database");
mysql_select_db($mysql_database, $bd) or die("Could not select database");
?>
</pre>
<p>&nbsp;</p>
<h3>STEP 3: Create search.php</h3>
<p>Out db is create and connected also, now we need to create php code that can search input query using ajax call.</p>
<pre name="code" class="html">
<?php
include('config.php');
$q = strtolower($_GET["q"]);
$limit = $_GET["limit"];

if($q)
{
	$sql_res=mysql_query("select * from countries where name like '%$q%' order by id LIMIT $limit");

		while($row=mysql_fetch_array($sql_res))
		{
		$result=$row['name'];
		echo "$result\n";
		}

}
else
{
	echo 'No records found.';
}

?>
</pre>
<p>&nbsp;</p>
<h3>STEP 4: Create index.html</h3>
<p>In last, create HTMl file with jQuery Ajax call which will call seach.php file and fact searched query from mysql db.<br />
We will includ css &#038; jQuery files in this.</p>
<pre name="code" class="html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<script type="text/javascript" src="../lib/jquery.js"></script>

<script type='text/javascript' src='../jquery.autocomplete.js'></script>
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="../jquery.autocomplete.css" />

<script type="text/javascript">
$().ready(function() {

	$("#singleBirdRemote").autocomplete("search.php", {
		width: 260,
		selectFirst: false
	});

	$("#singleBirdRemote").result(function(event, data, formatted) {
		if (data)
			$(this).parent().next().find("input").val(data[1]);
	});

});
</script>

</head>

<body>
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/">jQuery Autocomplete Example PHP AJAX</a> Demo</h1>
<div id="content">
<form autocomplete="off">


			<label>Single Bird (remote):</label>
<input type="text" id="singleBirdRemote" />
<input type="button" value="Get Value" />
<input type="submit" value="Submit" />
	</form>
</div>

</body>
</html>
</pre>
<h2><a title="jquery-autocomplete-php-mysql-example-demo" href="http://webdesignergeeks.com//tuts/Demo/jquery-autocomplete-php-mysql-example/demo/" target="_blank">DEMO</a> | <a title="jquery-autocomplete-php-mysql-example" href="http://webdesignergeeks.com/tuts/Download/jquery-autocomplete-php-mysql-example.zip" target="_blank">DOWNLAOD</a></h2>
<p>Jquery autocomplete php mysql example<br />
Cheers !  Isn&#8217;t is so easy, Let me know you have still facing any issue or suggestions.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="vas_pro_2"><div style="float:left; width:100px; " class="vas_pro_2_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebdesignergeeks.com%2Fcoding%2Fjquery-autocomplete-php-mysql-example%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="vas_pro_2_google1"> 
				<g:plusone size="medium" href="http://webdesignergeeks.com/coding/jquery-autocomplete-php-mysql-example/" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="vas_pro_2_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Jquery autocomplete php mysql example" data-url="http://webdesignergeeks.com/coding/jquery-autocomplete-php-mysql-example/">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.24wn.com">news and information</a><a href="http://www.forum1000.com">business,health,entertainment,technology</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div><p>Related posts:</p><ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/' rel='bookmark' title='How to Create Custom RSS Feed Using MySQL and PHP'>How to Create Custom RSS Feed Using MySQL and PHP</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/' rel='bookmark' title='Getting Start With CakePHP and jQuery'>Getting Start With CakePHP and jQuery</a></li>
</ol><p>The post <a href="http://webdesignergeeks.com/coding/jquery-autocomplete-php-mysql-example/">Jquery autocomplete php mysql example</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://webdesignergeeks.com/coding/jquery-autocomplete-php-mysql-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Create Custom RSS Feed Using MySQL and PHP</title>
		<link>http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/</link>
		<comments>http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/#comments</comments>
		<pubDate>Fri, 13 Jul 2012 06:15:33 +0000</pubDate>
		<dc:creator>Raoul Grosser</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Create Custom RSS Feed Using MySQL and PHP]]></category>
		<category><![CDATA[How to Create Custom RSS Feed Using MySQL and PHP]]></category>
		<category><![CDATA[RSS Feed Using MySQL and PHP]]></category>

		<guid isPermaLink="false">http://webdesignergeeks.com/?p=3194</guid>
		<description><![CDATA[<p>A RSS (Really Simple Syndication) feed is a XML-based format for your content. Most blogging platforms, for example, will have an RSS feed built in. Whenever you start publishing posts, your latest posts will be updated in the RSS feed. Visitors to your website can subscribe to your blog’s RSS feed in an RSS reader [...]</p><p>The post <a href="http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/">How to Create Custom RSS Feed Using MySQL and PHP</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>
Related posts:<ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/' rel='bookmark' title='How To Export MySql To CSV ?'>How To Export MySql To CSV ?</a></li>
<li><a href='http://webdesignergeeks.com/cms/wordpress/create-simple-wordpress-plugin-from-scratch-part-2/' rel='bookmark' title='Create simple  wordpress plugin From Scratch Part-2'>Create simple  wordpress plugin From Scratch Part-2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img alt="RSS" src="http://i.imgur.com/EG4d0.png" title="RSS" class="alignnone" width="300" height="300" /></p>
<p>A RSS (Really Simple Syndication) feed is a XML-based format for your content. Most blogging platforms, for example, will have an RSS feed built in. Whenever you start publishing posts, your latest posts will be updated in the RSS feed. Visitors to your website can subscribe to your blog’s RSS feed in an RSS reader such as Google Reader.</p>
<hr />
<h2>Tutorial Details</h2>
<ul>
<li><strong>Program</strong>: Notepad / Notepad++</li>
<li><strong>Version (if applicable)</strong>: PHP , MYSQL</li>
<li><strong>Difficulty</strong>: Beginner</li>
<li><strong>Estimated Completion Time</strong>: 30-50 Minutes</li>
</ul>
<hr />
<h2>Defining a Goal</h2>
<p>Our goal is to create RSS Feed System with a database.</p>
<h2><a href="http://pythonscanner.com/Raoul/RSS_Feed_RaoulGrosser.zip">Download</a></h2>
<p>Lets split the processes we are going to do in this tutorial.</p>
<ol>
<li>Create the database</li>
<li>Create the index page for the RSS items</li>
<li>Create the connector for the database connection</li>
<li>Create the class for getting information of the RSS items</li>
</ol>
<hr />
<h2>Step 1: Create the database.</h2>
<p>We will create two database tables, the first is called rss_details, which contains the details for the feed and the second is called rss_info, which contains all of the items.<em></em></p>
<p><strong>Note:</strong> Make sure you have created a database to be used with our RSS System and put the configuration parameters in step 3 of the tutorial.</p>
<p>Create a table in the database and name it rss_details. Then give the table the fields shown in Table-Img.</p>
<p><a href="http://i.imgur.com/VB8KK.jpg"><img class="alignnone  wp-image-3173" src="http://i.imgur.com/VB8KK.jpg" alt="" width="243" height="201" /></a></p>
<p>Create this simple table with this MySQL table query by the following CREATE TABLES statement:</p>
<pre name="code" class="html">
CREATE TABLE IF NOT EXISTS `rss_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text NOT NULL,
  `descr` text NOT NULL,
  `url` text NOT NULL,
  `image_info` text NOT NULL,
  `image_url` text NOT NULL,
  `image_source` text NOT NULL,
  `image_width` text NOT NULL,
  `image_height` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;</pre>
<p>We need to create a second table in the database and name it rss_info. Then give the table the fields shown in  Table-Img.</p>
<p><a href="http://i.imgur.com/glgyn.jpg"><img src="http://i.imgur.com/glgyn.jpg" alt="" width="171" height="141" /></a></p>
<p>Create this simple table with this MySQL table query by the following CREATE TABLES statement:</p>
<pre name="code" class="html">
CREATE TABLE IF NOT EXISTS `rss_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text NOT NULL,
  `descr` text NOT NULL,
  `url` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;</pre>
<p>&nbsp;</p>
<hr />
<h2>Step 2: Create the index page</h2>
<p>In the index.php file, we start by adding a header that will configure the content type of the document as valid XML and choose the charset that you need.<br />
Include the class.php, instantiate the object and trigger a method called GetFeed.<br />
The GetFeed method of a table delegate class or application delegate class returns an associative array of parameters to configure the RSS feed.</p>
<p>Create this simple index page with my write source:</p>
<pre name="code" class="php">     &lt;?
      header("Content-Type: application/xml; charset=ISO-8859-1");
      include("class.php");
      $rss = new RSS();
      echo $rss-&gt;GetFeed();
     ?&gt;</pre>
<p>&nbsp;</p>
<hr />
<h2>Step 3: Create connector for the database.</h2>
<p>The connector.php file defines our database connection information, makes the initial connection and selects the defined database.</p>
<pre name="code" class="php">     &lt;?
      DEFINE ('DB_USER', 'your_name');
      DEFINE ('DB_PASSWORD', 'your_password');
      DEFINE ('DB_HOST', 'localhost');
      DEFINE ('DB_NAME', 'your_databasename');
      <span style="color: #007700">//connection to the database</span>
      $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
      mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
    ?&gt;</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<hr />
<h2>Step 4: Create the class for getting information of the RSS items</h2>
<p>The RSS class constructor is a public method that requires the connector.php file. Remember to put this file in a safe location on your server so it&#8217;s not exposed to hackers. Once the file&#8217;s in place change the path in the file index.php on line 3.</p>
<pre name="code" class="php">&lt;?
  class RSS
  {
    public function RSS()
    {
        require_once ('connector.php');
    }
    public function GetFeed()
    {
        return $this-&gt;getDetails() . $this-&gt;getItems();
    }
    private function dbConnect()
    {
        DEFINE ('LINK', mysql_connect (DB_HOST, DB_USER, DB_PASSWORD));
    }
    private function getDetails()
    {
        $detailsTable = "rss_details";
        $this-&gt;dbConnect($detailsTable);
        $query = "SELECT * FROM ". $detailsTable;
        $result = mysql_db_query (DB_NAME, $query, LINK);
        while($row = mysql_fetch_array($result))
        {
            $details = '&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
                &lt;rss version="2.0"&gt;
                    &lt;channel&gt;
                        &lt;title&gt;'. $row['title'] .'&lt;/title&gt;
                        &lt;link&gt;'. $row['link'] .'&lt;/link&gt;
                        &lt;description&gt;'. $row['description'] .'&lt;/description&gt;
                        &lt;language&gt;'. $row['language'] .'&lt;/language&gt;
                        &lt;image&gt;
                            &lt;title&gt;'. $row['image_title'] .'&lt;/title&gt;
                            &lt;url&gt;'. $row['image_url'] .'&lt;/url&gt;
                            &lt;link&gt;'. $row['image_link'] .'&lt;/link&gt;
                            &lt;width&gt;'. $row['image_width'] .'&lt;/width&gt;
                            &lt;height&gt;'. $row['image_height'] .'&lt;/height&gt;
                        &lt;/image&gt;';
        }
        return $details;
    }
    private function getItems()
    {
        $itemsTable = "rss_info";
        $this-&gt;dbConnect($itemsTable);
        $query = "SELECT * FROM ". $itemsTable;
        $result = mysql_db_query (DB_NAME, $query, LINK);
        $items = '';
        while($row = mysql_fetch_array($result))
        {
            $items .= '&lt;item&gt;
                &lt;title&gt;'. $row["title"] .'&lt;/title&gt;
                &lt;link&gt;'. $row["link"] .'&lt;/link&gt;
                &lt;description&gt;&lt;![CDATA['. $row["description"] .']]&gt;&lt;/description&gt;
            &lt;/item&gt;';
        }
        $items .= '&lt;/channel&gt;
                &lt;/rss&gt;';
        return $items;
    }
}
?&gt;</pre>
<h2><a href="http://pythonscanner.com/Raoul/RSS_Feed_RaoulGrosser.zip">Download</a></h2>
<p>Congratulations, you finished your Custom RSS Feed.</p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="vas_pro_2"><div style="float:left; width:100px; " class="vas_pro_2_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebdesignergeeks.com%2Fcoding%2Fhow-to-create-custom-rss-feed-using-mysql-and-php%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="vas_pro_2_google1"> 
				<g:plusone size="medium" href="http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="vas_pro_2_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="How to Create Custom RSS Feed Using MySQL and PHP" data-url="http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.24wn.com">news and information</a><a href="http://www.forum1000.com">business,health,entertainment,technology</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div><p>Related posts:</p><ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/' rel='bookmark' title='How To Export MySql To CSV ?'>How To Export MySql To CSV ?</a></li>
<li><a href='http://webdesignergeeks.com/cms/wordpress/create-simple-wordpress-plugin-from-scratch-part-2/' rel='bookmark' title='Create simple  wordpress plugin From Scratch Part-2'>Create simple  wordpress plugin From Scratch Part-2</a></li>
</ol><p>The post <a href="http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/">How to Create Custom RSS Feed Using MySQL and PHP</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://webdesignergeeks.com/coding/how-to-create-custom-rss-feed-using-mysql-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funny questions with funny answers &#8211; stackoverflow</title>
		<link>http://webdesignergeeks.com/coding/ajax-js/funny-questions-with-funny-answers-on-stackoverflow/</link>
		<comments>http://webdesignergeeks.com/coding/ajax-js/funny-questions-with-funny-answers-on-stackoverflow/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 19:05:57 +0000</pubDate>
		<dc:creator>Ratan</dc:creator>
				<category><![CDATA[AJAX & CSS]]></category>
		<category><![CDATA[AJAX & JS]]></category>
		<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://webdesignergeeks.com/?p=2413</guid>
		<description><![CDATA[<p>Stack Overflow is a programming Q &#38; A site that’s free. Free to ask questions, free to answer questions, free to read, free to index, built with plain old HTML, no fake rot13 text on the home page, no scammy google-cloaking tactics, no salespeople, no JavaScript windows dropping down in front of the answer asking for [...]</p><p>The post <a href="http://webdesignergeeks.com/coding/ajax-js/funny-questions-with-funny-answers-on-stackoverflow/">Funny questions with funny answers &#8211; stackoverflow</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a title="stackoverflow" href="http://stackoverflow.com/about" target="_blank">Stack Overflow</a> is <strong>a programming Q &amp; A site that’s free</strong>. Free to ask questions, free to answer questions, free to read, free to index, built with plain old HTML, no fake rot13 text on the home page, no scammy google-cloaking tactics, no salespeople, no JavaScript windows dropping down in front of the answer asking for $12.95 to go away. You can register if you want to collect karma and win valuable flair that will appear next to your name, but otherwise, it’s just free. And fast. Very, very fast.</p>
<p>When I stuck with some problem <a title="stackoverflow" href="http://stackoverflow.com/about" target="_blank">Stack Overflow</a> helps me a lot to find answer for my question.Stack Overflow is <strong>collaboratively built and maintained by your fellow programmers</strong>.</p>
<p>In this post I have listed some Funny questions with funny answers on stackoverflow seen in my programming life.</p>
<p>&nbsp;</p>
<h2><a href="http://stackoverflow.com/questions/182112/what-are-some-funny-loading-statements-to-keep-users-amused" target="_blank">1. What are some funny loading statements to keep users amused?</a></h2>
<p>&nbsp;</p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/question.png"><img class="alignnone size-full wp-image-2414" title="question" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/question.png" alt="" width="617" height="608" /></a></p>
<p><strong>Answer</strong></p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/answer.png"><img class="alignnone  wp-image-2415" title="answer" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/answer.png" alt="" width="586" height="179" /></a></p>
<h2><a href="http://meta.stackoverflow.com/q/99062/155556" target="_blank">2. Don&#8217;t close questions where the user has requested that it not be closed</a></h2>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/metaclose.png"><img class="alignnone  wp-image-2416" title="metaclose" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/metaclose.png" alt="" width="572" height="542" /></a></p>
<p><strong>Answer</strong></p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/metacloseanswer.png"><img class="alignnone  wp-image-2417" title="metacloseanswer" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/metacloseanswer.png" alt="" width="582" height="374" /></a></p>
<p>&nbsp;</p>
<h2><a href="http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java" target="_blank">3.What&#8217;s the difference between JavaScript and Java?</a></h2>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/JavavsJavascript.png"><img class="alignnone  wp-image-2418" title="JavavsJavascript" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/JavavsJavascript.png" alt="" width="589" height="183" /></a></p>
<p><strong>Answer</strong></p>
<p>&nbsp;</p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/Answer1.png"><img class="alignnone  wp-image-2432" title="Answer1" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/Answer1.png" alt="" width="593" height="111" /></a></p>
<h2><a href="http://stackoverflow.com/questions/6577515/disclaimer-privacy-terms-conditions/" target="_blank">4 .Disclaimer | Privacy | Terms &amp; Condition</a></h2>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/what..png"><img class="alignnone  wp-image-2420" title="what." src="http://webdesignergeeks.com/wp-content/uploads/2012/03/what..png" alt="" width="617" height="335" /></a></p>
<p><strong>Answer</strong></p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/ahh.png"><img class="alignnone  wp-image-2421" title="ahh" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/ahh.png" alt="" width="589" height="282" /></a></p>
<h2><a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags" target="_blank">5. RegEx match open tags except XHTML self-contained tags</a></h2>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/regex.png"><img class="alignnone  wp-image-2422" title="regex" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/regex.png" alt="" width="592" height="434" /></a></p>
<p><strong>Answer</strong></p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/regexa.png"><img class="alignnone  wp-image-2423" title="regexa" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/regexa.png" alt="" width="590" height="458" /></a></p>
<h3><a href="http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered/482129#482129" target="_blank">6. What is the best comment in source code you have ever encountered?</a></h3>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/sourceCode.png"><img class="alignnone  wp-image-2424" title="sourceCode" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/sourceCode.png" alt="" width="559" height="231" /></a></p>
<p><strong>Answer</strong></p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/sourceCodeAnswer.png"><img class="alignnone  wp-image-2425" title="sourceCodeAnswer" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/sourceCodeAnswer.png" alt="" width="590" height="483" /></a></p>
<p>&nbsp;</p>
<p><strong>Bonus funny question on Yahoo !</strong></p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/03/422574_409222829093563_284701571545690_1918961_1392152747_n.jpg"><img class="alignnone  wp-image-2426" title="422574_409222829093563_284701571545690_1918961_1392152747_n" src="http://webdesignergeeks.com/wp-content/uploads/2012/03/422574_409222829093563_284701571545690_1918961_1392152747_n.jpg" alt="" width="511" height="374" /></a></p>
<p>&nbsp;</p>
<p>Please help us via sharing this post if you like, and do not forget to comment if you found even more funny question with answer <img src='http://webdesignergeeks.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="vas_pro_2"><div style="float:left; width:100px; " class="vas_pro_2_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebdesignergeeks.com%2Fcoding%2Fajax-js%2Ffunny-questions-with-funny-answers-on-stackoverflow%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="vas_pro_2_google1"> 
				<g:plusone size="medium" href="http://webdesignergeeks.com/coding/ajax-js/funny-questions-with-funny-answers-on-stackoverflow/" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="vas_pro_2_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Funny questions with funny answers &#8211; stackoverflow" data-url="http://webdesignergeeks.com/coding/ajax-js/funny-questions-with-funny-answers-on-stackoverflow/">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.24wn.com">news and information</a><a href="http://www.forum1000.com">business,health,entertainment,technology</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div><p>No related posts.</p><p>The post <a href="http://webdesignergeeks.com/coding/ajax-js/funny-questions-with-funny-answers-on-stackoverflow/">Funny questions with funny answers &#8211; stackoverflow</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://webdesignergeeks.com/coding/ajax-js/funny-questions-with-funny-answers-on-stackoverflow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Export MySql To CSV ?</title>
		<link>http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/</link>
		<comments>http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 19:15:26 +0000</pubDate>
		<dc:creator>Ratan</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://webdesignergeeks.com/?p=2188</guid>
		<description><![CDATA[<p>In most of project mostly clients wants to export their database in to CSV / Eecel file. It will help us to make a simple record or in future we can also import the same data in to MySql database. In this article, I will explain you How To Export MySql To CSV ? very easily. Download &#160; [...]</p><p>The post <a href="http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/">How To Export MySql To CSV ?</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>
Related posts:<ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/mobile/android/android-login-authentication-with-remote-db/' rel='bookmark' title='Android login authentication with remote (MySql)database'>Android login authentication with remote (MySql)database</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/' rel='bookmark' title='Getting Start With CakePHP and jQuery'>Getting Start With CakePHP and jQuery</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In most of project mostly clients wants to export their database in to CSV / Eecel file. It will help us to make a simple record or in future we can also import the same data in to MySql database.</p>
<p>In this article, I will explain you <strong>How To Export MySql To CSV ? </strong>very easily.</p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/02/Export_MySql_To_CSV.png"><img class="alignnone size-full wp-image-2191" title="Export_MySql_To_CSV" src="http://webdesignergeeks.com/wp-content/uploads/2012/02/Export_MySql_To_CSV.png" alt="Export_MySql_To_CSV" width="600" height="300" /></a><br />
<center><br />
<h2><a href="http://webdesignergeeks.com//tuts/Download/Export_MySql_To_CSV.rar" title="Export_MySql_To_CSV">Download</a></h2>
<p></center><br />
&nbsp;</p>
<h2>STEP 1:Assigning  the Mysql database &amp; table.</h2>
<ul>
<li>$host: Hostname or an ip adress. it is usualy <strong>localhost</strong>.</li>
<li>$db: Mysql user account used to access the database.</li>
<li>$user: this is the password for the Mysql user account.It is usualy <strong>root</strong>.</li>
<li>$pass: this is the name of the Mysql database used.It is usualy blank.</li>
<li>$table: The name of the table that you want from Mysql to csv.</li>
</ul>
<p>[adsense]</p>
<h2></h2>
<h2>STEP2: Creating the connection to the Mysql database-export.php</h2>
<p>In this function, I will create a simple MySql database connection using the above assigning variable.</p>
<p>Now as you can see we are calling here exportMysqlToCsv($table) function and passing the name of table. In Next step we will create this function.</p>
<pre name="code" class="html">
&lt;?php

$host = 'localhost'; // MYSQL database host adress
$db = ''; // MYSQL database name
$user = ''; // Mysql Datbase user
$pass = ''; // Mysql Datbase password

// Connect to the database
$link = mysql_connect($host, $user, $pass);
mysql_select_db($db);

require 'exportMysqlToCsv.inc.php';

$table=""; // this is the tablename that you want to export to csv from mysql.

exportMysqlToCsv($table);

?&gt;
</pre>
<p>&nbsp;</p>
<h2>STEP3: Creating &#8216;exportMysqlToCsv&#8217; function-exportMysqlToCsv.inc.php</h2>
<p>Create a php file and named it as &#8216;exportMysqlToCsv.inc.php&#8217;.</p>
<pre name="code" class="html">
&lt;?php

function exportMysqlToCsv($table,$filename = 'export.csv')
{
	$csv_terminated = "\n";
	$csv_separator = ",";
	$csv_enclosed = '"';
	$csv_escaped = "\\";
	$sql_query = "select * from $table";

	// Gets the data from the database
	$result = mysql_query($sql_query);
	$fields_cnt = mysql_num_fields($result);

	$schema_insert = '';

	for ($i = 0; $i < $fields_cnt; $i++)
	{
		$l = $csv_enclosed . str_replace($csv_enclosed, $csv_escaped . $csv_enclosed,
			stripslashes(mysql_field_name($result, $i))) . $csv_enclosed;
		$schema_insert .= $l;
		$schema_insert .= $csv_separator;
	} // end for

	$out = trim(substr($schema_insert, 0, -1));
	$out .= $csv_terminated;

	// Format the data
	while ($row = mysql_fetch_array($result))
	{
		$schema_insert = '';
		for ($j = 0; $j < $fields_cnt; $j++)
		{
			if ($row[$j] == '0' || $row[$j] != '')
			{

				if ($csv_enclosed == '')
				{
					$schema_insert .= $row[$j];
				} else
				{
					$schema_insert .= $csv_enclosed .
					str_replace($csv_enclosed, $csv_escaped . $csv_enclosed, $row[$j]) . $csv_enclosed;
				}
			} else
			{
				$schema_insert .= '';
			}

			if ($j < $fields_cnt - 1)
			{
				$schema_insert .= $csv_separator;
			}
		} // end for

		$out .= $schema_insert;
		$out .= $csv_terminated;
	} // end while

	header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
	header("Content-Length: " . strlen($out));
	// Output to browser with appropriate mime type, you choose <img src='http://webdesignergeeks.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
	header("Content-type: text/x-csv");
	//header("Content-type: text/csv");
	//header("Content-type: application/csv");
	header("Content-Disposition: attachment; filename=$filename");
	echo $out;
	exit;

}

?&gt;
</pre>
<p>As you can see the code in this function we are passing the table name using $table variable.</p>
<p>In this example default filename of the exported file is <em>export.csv. </em>you can change it as you like to append date.(ex.export-18-06-2012.csv)</p>
<p><center><br />
<h2><a href="http://webdesignergeeks.com//tuts/Download/Export_MySql_To_CSV.rar" title="Export_MySql_To_CSV">Download</a></h2>
<p></center></p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="vas_pro_2"><div style="float:left; width:100px; " class="vas_pro_2_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebdesignergeeks.com%2Ftutorials%2Fphp-tutorials%2Fhow-to-export-mysql-to-csv%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="vas_pro_2_google1"> 
				<g:plusone size="medium" href="http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="vas_pro_2_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="How To Export MySql To CSV ?" data-url="http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.24wn.com">news and information</a><a href="http://www.forum1000.com">business,health,entertainment,technology</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div><p>Related posts:</p><ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/mobile/android/android-login-authentication-with-remote-db/' rel='bookmark' title='Android login authentication with remote (MySql)database'>Android login authentication with remote (MySql)database</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/' rel='bookmark' title='Getting Start With CakePHP and jQuery'>Getting Start With CakePHP and jQuery</a></li>
</ol><p>The post <a href="http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/">How To Export MySql To CSV ?</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://webdesignergeeks.com/tutorials/php-tutorials/how-to-export-mysql-to-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Start With CakePHP &#8211; Beginner Tutorial</title>
		<link>http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/</link>
		<comments>http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 17:59:49 +0000</pubDate>
		<dc:creator>Ratan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Cakephp AJAX]]></category>
		<category><![CDATA[CakePHP and jQuery]]></category>
		<category><![CDATA[CakePHP Beginner Tutorial]]></category>
		<category><![CDATA[Getting Start With CakePHP]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://webdesignergeeks.com/?p=1904</guid>
		<description><![CDATA[<p>CakePHP CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code. In this tutorial i have explained basics of CakePHP. How [...]</p><p>The post <a href="http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/">Getting Start With CakePHP &#8211; Beginner Tutorial</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>
Related posts:<ol>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/' rel='bookmark' title='Getting Start With CakePHP and jQuery'>Getting Start With CakePHP and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/mobile/blackbarry/getting-start-with-blackberry-webworks-javascript-extension/' rel='bookmark' title='Getting Start With BlackBerry WebWorks JavaScript Extension'>Getting Start With BlackBerry WebWorks JavaScript Extension</a></li>
<li><a href='http://webdesignergeeks.com/mobile/iphone-ipad/top-10-iphone-app-development-tutorial-blogs/' rel='bookmark' title='Top 10 iPhone App Development Tutorial blogs'>Top 10 iPhone App Development Tutorial blogs</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h3>CakePHP</h3>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/01/2.png"><img src="http://webdesignergeeks.com/wp-content/uploads/2012/01/2.png" alt="Getting Start With CakePHP." title="Getting Start With CakePHP." width="230" height="225" class="alignnone size-full wp-image-1919" /></a><br />
<a href="http://cakephp.org/" title="cakephp" target="_blank">CakePHP</a> is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications.	 Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.<br />
In this tutorial i have explained basics of CakePHP. How to <a href="http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/" title="Getting Start With CakePHP" target="_blank">Getting Start With CakePHP.</a></p>
<hr/>
<h2>MVC architecture</h2>
<p><strong>Model–view–controller</strong> (<strong>MVC</strong>) is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates &#8220;domain logic&#8221; (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each.</p>
<p><img class="alignnone size-full wp-image-1907" title="CakePHP mvc architecture" src="http://webdesignergeeks.com/wp-content/uploads/2012/01/mvc.png" alt="CakePHP mvc architecture" width="500" height="400" /></p>
<p>Model View Controller (MVC) pattern creates applications that separate the different aspects of the application (input logic, business logic, and UI logic), while providing a loose coupling between these elements</p>
<p>&nbsp;</p>
<hr />
<div class="tutorial_image" id="adsense-block">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2199797335203371";
/* WDG in Post 336 280 */
google_ad_slot = "4690709747";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<h2>Basics of CakePhp</h2>
<p><strong>Folder Structure</strong></p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2012/01/cakephp-directory-structures-1.png"><img class="alignnone size-full wp-image-1908" title="cakephp-directory-structures" src="http://webdesignergeeks.com/wp-content/uploads/2012/01/cakephp-directory-structures-1.png" alt="cakephp-directory-structures" width="313" height="325" /></a></p>
<hr />
<h2>Naming conventions</h2>
<p>View–<strong>Class name :</strong>MyFirstClass | <strong>filename:</strong> my_first_name.php<br />
Model–<strong>Classname:</strong> Book | <strong>tablename:</strong> books<br />
Controller–<strong>Classname:</strong> BooksController<br />
<strong>Ex:</strong><br />
<strong>Database table :</strong> books<br />
<strong>Model class :</strong> Book<br />
<strong>Controller class :</strong> BooksController<br />
<em>View found at : /app/views/books/index.ctp</em></p>
<hr />
<h2>Steps</h2>
<p>Getting Start With CakePHP</p>
<ol>
<li>Creating the database</li>
<li>Creating a model</li>
<li>Creating a controller</li>
<li>Creating the views</li>
</ol>
<hr />
<h2>1. Creating the database</h2>
<ul>
<li>Create a new table (name should be according to the naming conventions)</li>
<li>Enter the data.</li>
<li>(Using phpmyadmin)</li>
</ul>
<hr />
<h2>2. Creating a model</h2>
<ul>
<li>Separates the domain logic from presentation isolating the application logic.</li>
<li>Extends AppModel(extends Model)</li>
<li>Contains data validation rules, association information and methods specific to the table it uses.</li>
<li>For complete reference http://api.cakephp.org</li>
<li>Cakephpdynamically creates a model object</li>
</ul>
<p><code><br />
class Book extends AppModel{<br />
var$name = ‘Book';<br />
}<br />
</code></p>
<ul>
<li>We do can add some behaviors to each model.</li>
</ul>
<hr />
<h2>3. Creating a controller</h2>
<ul>
<li>Manages the logic for a part of our application</li>
<li>Can access the model object by $this-&gt;Book</li>
</ul>
<p><code><br />
class BooksControllerextends AppController{<br />
var$name = 'Books';<br />
function index() {<br />
$this-&gt;set('books', $this-&gt;Book-&gt;find('all'));<br />
}<br />
}<br />
$this-&gt;loadModel(‘Article'); loads a different model<br />
</code></p>
<ul>
<li>Components (packages of logic that are shared between controllers)</li>
</ul>
<hr />
<h2>4. Creating the views</h2>
<ul>
<li>Layouts (placed in /app/views/layouts)</li>
<li>Elements (reusable parts)</li>
</ul>
<p>Helpers<br />
<code><br />
(var$helpers = array('Form', 'Html', 'Javascript', 'Time');)<br />
</code></p>
<hr />
<p><strong>Sample model</strong></p>
<pre name="code" class="php">
<?php class Book extends AppModel { var$name = 'Book'; var$validate = array( 'title' =--> array(
'rule' =&gt; 'notEmpty'
),
'author' =&gt; array(
'rule' =&gt; 'notEmpty'
)
);
}
?>
</pre>
<p><strong>Sample Controller</strong></p>
<pre name="code" class="php">
<!?php class BooksControllerextends AppController{ var$name = 'Books'; var$helpers = array('Html','Ajax','Javascript'); function index() { $this->set('books', $this-&gt;Book-&gt;find('all'));
}
function view($id = null) {
$this-&gt;Book-&gt;id = $id;
$this-&gt;set('book', $this-&gt;Book-&gt;read());
print_r($this-&gt;viewVars);
}
}
</pre>
<p><strong>Sample view</strong><br />
Books</p>
<pre name="code" class="php">
<table>
<tbody>
<tr>
<th>Id</th>
<th>Title</th>
<th>Author</th>
</tr>
<tr>
<td></td>
<td><!--?phpecho $html--->link($book*‘Book+*'title'+,
array('controller' =&gt; ‘books’, 'action' =&gt; 'view', $book*‘Book+*'id'+)); ?&gt;</td>
<td></td>
</tr>
</tbody>
</table>
</pre>
<p>References : <a title="cakephp" href="http://book.cakephp.org/view/4/Beginning-With-CakePHP" target="_blank">http://book.cakephp.org/view/4/Beginning-With-CakePHP</a></code><br />
<a href="http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/" title="Getting Start With CakePHP" target="_blank">Getting Start With CakePHP.</a></p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="vas_pro_2"><div style="float:left; width:100px; " class="vas_pro_2_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebdesignergeeks.com%2Fcoding%2Fphp%2Fgetting-start-with-cakephp-beginner-tutorial%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="vas_pro_2_google1"> 
				<g:plusone size="medium" href="http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="vas_pro_2_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Getting Start With CakePHP &#8211; Beginner Tutorial" data-url="http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.24wn.com">news and information</a><a href="http://www.forum1000.com">business,health,entertainment,technology</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div><p>Related posts:</p><ol>
<li><a href='http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/' rel='bookmark' title='Getting Start With CakePHP and jQuery'>Getting Start With CakePHP and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/mobile/blackbarry/getting-start-with-blackberry-webworks-javascript-extension/' rel='bookmark' title='Getting Start With BlackBerry WebWorks JavaScript Extension'>Getting Start With BlackBerry WebWorks JavaScript Extension</a></li>
<li><a href='http://webdesignergeeks.com/mobile/iphone-ipad/top-10-iphone-app-development-tutorial-blogs/' rel='bookmark' title='Top 10 iPhone App Development Tutorial blogs'>Top 10 iPhone App Development Tutorial blogs</a></li>
</ol><p>The post <a href="http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/">Getting Start With CakePHP &#8211; Beginner Tutorial</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://webdesignergeeks.com/coding/php/getting-start-with-cakephp-beginner-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting Start With CakePHP and jQuery</title>
		<link>http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/</link>
		<comments>http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 18:27:50 +0000</pubDate>
		<dc:creator>Ratan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Cakephp AJAX]]></category>
		<category><![CDATA[CakePHP and jQuery]]></category>
		<category><![CDATA[Getting Start With CakePHP and jQuery]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://webdesignergeeks.com/?p=1867</guid>
		<description><![CDATA[<p>Tutorial Details Program: CakePHP Version (if applicable): 1.3.14 Stable + Difficulty: Intermediate Estimated Completion Time: 30 &#8211; 45 minutes In this Tutorial, i will teach how to use JQuery in CakePHP to do ajax save. The final task is to save a record through Ajax using JQuery. Table Of Content Creating Database Creating View File Creating Controller Action [...]</p><p>The post <a href="http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/">Getting Start With CakePHP and jQuery</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>
Related posts:<ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/mobile/blackbarry/getting-start-with-blackberry-webworks-javascript-extension/' rel='bookmark' title='Getting Start With BlackBerry WebWorks JavaScript Extension'>Getting Start With BlackBerry WebWorks JavaScript Extension</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/jquery/top-10-jquery-tutorials-you-should-know/' rel='bookmark' title='Top 10 Jquery Tutorials you should know'>Top 10 Jquery Tutorials you should know</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1877" style="border-style: initial; border-color: initial;" title="cakephp-development-banner" src="http://webdesignergeeks.com/wp-content/uploads/2012/01/cakephp-development-banner.jpg" alt="cakephp-development-banner" width="300" height="200" /></p>
<p><strong>Tutorial Detai</strong><strong>ls</strong></p>
<p><strong>Program:</strong> CakePHP<br />
<strong>Version (if applicable):</strong> <a href="https://github.com/cakephp/cakephp/zipball/1.3.14">1.3.14 Stable</a> +<br />
<strong>Difficulty:</strong> Intermediate<br />
<strong>Estimated Completion Time:</strong> 30 &#8211; 45 minutes</p>
<p>In this Tutorial, i will teach how to use JQuery in CakePHP to do ajax save. The final task is to save a record through Ajax using JQuery.</p>
<hr />
<h2></h2>
<h2>Table Of Content</h2>
<ol>
<li>Creating Database</li>
<li>Creating View File</li>
<li>Creating Controller Action</li>
<li>Setup jQuery AJAX call</li>
<li>Final code</li>
</ol>
<hr />
<h2></h2>
<h2>1. Creating Database</h2>
<p>Create a simple database table:</p>
<p><code>CREATE TABLE IF NOT EXISTS `employee` (<br />
`id` int(11) NOT NULL AUTO_INCREMENT,<br />
`name` varchar(250) COLLATE latin1_general_ci NOT NULL,<br />
`email` varchar(250) COLLATE latin1_general_ci NOT NULL,<br />
PRIMARY KEY (`id`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=61 ;</code></p>
<p>Give correct database information at app/config/database.php and make sure that CakePHP is able to connect to your database.</p>
<hr />
<h2></h2>
<h2>2. Creating View File</h2>
<p>Setting up view is very straightforward, what we need to do is simply create a form using CakePHP form helper, assign the form an unique id and point its action to &#8220;/Employee/add&#8221;, open &#8220;app/views/employee/index.ctp&#8221; and add codes below:</p>
<p><code><!--?php echo $this--->Form-&gt;create('Employee',array('action'=&gt;'add','id'=&gt;'saveForm'));<br />
echo $this-&gt;Form-&gt;input('name',array('id'=&gt;'name'));<br />
echo $this-&gt;Form-&gt;input('email',array('id'=&gt;'email'));<br />
echo $this-&gt;Form-&gt;submit('Save',array('id'=&gt;'show_hide'));<br />
echo $this-&gt;Form-&gt;end();</code></p>
<p>?&gt;</p>
<hr />
<h2></h2>
<h2>3. Creating Controller Action</h2>
<p>Create &#8220;app/controllers/employee_controller.php&#8221;, take note we included RequestHandler here because we need it later to detect ajax request:<br />
<code><!--?php class EmployeeController extends AppController { public $helpers = array('Form', 'Html'); public $name = 'Employee'; public $components = array('RequestHandler'); public function index() { $this--->layout='default';<br />
}</code></p>
<p>}</p>
<p>?&gt;<br />
We have point the form action to &#8220;employee/add&#8221;, so we need to set up the controller action for it here. Open &#8220;app/controllers/employee_controller.php&#8221;, and add function add() as below. Firstly, we set autoRender to false, because we don&#8217;t need a view for this action. Then we detect if it is an ajax request using RequestHandler, if so, we set debug to 0, so CakePHP will not append any message to it even you turn debug level higher than 0 from global config. At last, we save the record by calling model function, and output status string.public<br />
<code>function add()<br />
{<br />
$this-&gt;autoRender=false;if($this-&gt;RequestHandler-&gt;isAjax())<br />
{<br />
Configure::write('debug', 0);<br />
}if(!empty($this-&gt;data))<br />
{<br />
if($this-&gt;Employee-&gt;save($this-&gt;data))<br />
{<br />
echo 'Record has been added';<br />
}<br />
else<br />
{<br />
echo 'Error while adding record';<br />
}<br />
}<br />
}<br />
</code></p>
<hr />
<h2></h2>
<h2>4. Setup jQuery AJAX call</h2>
<p>Finally we come to use JQuery to do ajax submit from view to controller, we have decided to put JQuery codes in layout file, just to make it easier to organize. Open &#8220;app/views/layouts/default.ctp&#8221;, and add JQuery codes inside header section of the document as below. What we did here is, firstly we serialize the form data and get form action url. Then we call $.ajax() function to do the magic.<br />
<code><script type="text/javascript">// <![CDATA[
 $(document).ready(function () { $(".slidingDiv").hide(); $('#saveForm').submit(function(){ //serialize form data var formData = $(this).serialize(); //get form action var formUrl = $(this).attr('action'); $.ajax({ type: 'POST', url: formUrl, data: formData, success: function(data,textStatus,xhr){ $(".slidingDiv").slideToggle(); }, error: function(xhr,textStatus,error) { alert(textStatus); } }); return false; }); });
// ]]&gt;</script></code></p>
<hr />
<h2></h2>
<h2>5. Final Code</h2>
<p>Completed codes for view, controller and layout:</p>
<p><strong>&#8220;app/views/employee/index.ctp&#8221;</strong><br />
<code><!--?php echo $this--->Form-&gt;create('Employee',array('action'=&gt;'add','id'=&gt;'saveForm'));<br />
echo $this-&gt;Form-&gt;input('name',array('id'=&gt;'name'));<br />
echo $this-&gt;Form-&gt;input('email',array('id'=&gt;'email'));<br />
echo $this-&gt;Form-&gt;submit('Save',array('id'=&gt;'show_hide'));<br />
echo $this-&gt;Form-&gt;end();</code></p>
<p>?&gt;<br />
<strong>&#8220;app/controllers/employee_controller.php&#8221;</strong><br />
<code><!--?php class EmployeeController extends AppController { public $helpers = array('Form', 'Html'); public $name = 'Employee'; public $components = array('RequestHandler'); public function index() { $this--->layout='default';<br />
}</code></p>
<p>public function add()<br />
{<br />
$this-&gt;autoRender=false;</p>
<p>if($this-&gt;RequestHandler-&gt;isAjax())<br />
{<br />
Configure::write(&#8216;debug&#8217;, 0);<br />
}</p>
<p>if(!empty($this-&gt;data))<br />
{<br />
if($this-&gt;Employee-&gt;save($this-&gt;data))<br />
{<br />
echo &#8216;Record has been added&#8217;;<br />
}<br />
else<br />
{<br />
echo &#8216;Error while adding record&#8217;;<br />
}<br />
}<br />
}<br />
}</p>
<p>?&gt;<br />
If you like our Employeeial, please share this post and help me spread the word. I need your support to continue.</p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="vas_pro_2"><div style="float:left; width:100px; " class="vas_pro_2_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebdesignergeeks.com%2Ftutorials%2Fphp-tutorials%2Fgetting-start-with-cakephp-and-jquery%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="vas_pro_2_google1"> 
				<g:plusone size="medium" href="http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="vas_pro_2_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Getting Start With CakePHP and jQuery" data-url="http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.24wn.com">news and information</a><a href="http://www.forum1000.com">business,health,entertainment,technology</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div><p>Related posts:</p><ol>
<li><a href='http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/' rel='bookmark' title='Create Ajax Search Using PHP MYSQL and jQuery'>Create Ajax Search Using PHP MYSQL and jQuery</a></li>
<li><a href='http://webdesignergeeks.com/mobile/blackbarry/getting-start-with-blackberry-webworks-javascript-extension/' rel='bookmark' title='Getting Start With BlackBerry WebWorks JavaScript Extension'>Getting Start With BlackBerry WebWorks JavaScript Extension</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/jquery/top-10-jquery-tutorials-you-should-know/' rel='bookmark' title='Top 10 Jquery Tutorials you should know'>Top 10 Jquery Tutorials you should know</a></li>
</ol><p>The post <a href="http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/">Getting Start With CakePHP and jQuery</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://webdesignergeeks.com/tutorials/php-tutorials/getting-start-with-cakephp-and-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create Ajax Search Using PHP MYSQL and jQuery</title>
		<link>http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/</link>
		<comments>http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 12:12:14 +0000</pubDate>
		<dc:creator>Ratan</dc:creator>
				<category><![CDATA[AJAX & CSS]]></category>
		<category><![CDATA[AJAX & JS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Create Ajax Search Using PHP MYSQL and jQuery]]></category>

		<guid isPermaLink="false">http://webdesignergeeks.com/?p=1201</guid>
		<description><![CDATA[<p>This tutorial shows how to create simple and attractive Ajax based search using PHP, jQuery, MySQL and Ajax. Demo File Structure  Download First of all create database ajax_demo , then create table ajax_search. CREATE TABLE `ajax_search` ( `id` int(11) NOT NULL auto_increment, `FirstName` varchar(50) NOT NULL, `LastName` varchar(50) NOT NULL, `Age` int(11) NOT NULL, `Hometown` varchar(50) [...]</p><p>The post <a href="http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/">Create Ajax Search Using PHP MYSQL and jQuery</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>
Related posts:<ol>
<li><a href='http://webdesignergeeks.com/cms/wordpress/create-simple-wordpress-plugin-from-scratch-part-2/' rel='bookmark' title='Create simple  wordpress plugin From Scratch Part-2'>Create simple  wordpress plugin From Scratch Part-2</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/jquery/top-10-jquery-tutorials-you-should-know/' rel='bookmark' title='Top 10 Jquery Tutorials you should know'>Top 10 Jquery Tutorials you should know</a></li>
<li><a href='http://webdesignergeeks.com/cms/wordpress/create-simple-wordpress-plugin-from-scratch/' rel='bookmark' title='Create simple  wordpress plugin From Scratch Part-1'>Create simple  wordpress plugin From Scratch Part-1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This tutorial shows how to create simple and attractive Ajax based search using PHP, jQuery, MySQL and Ajax.</p>
<p><a href="http://webdesignergeeks.com/wp-content/uploads/2011/11/Capture5.png"><img class="alignnone size-full wp-image-1203" title="Create Ajax Search Using PHP jQuery and MYSQL" src="http://webdesignergeeks.com/wp-content/uploads/2011/11/Capture5.png" alt="Create Ajax Search Using PHP jQuery and MYSQL" width="516" height="255" /></a></p>
<p><center><a class="super button blue" href="http://webdesignergeeks.com/tuts/Demo/ajax_search/" rel="novollow"><strong>Demo</strong></a></center><br />
<strong>File Structure </strong></p>
<p><strong></strong><a href="http://webdesignergeeks.com/wp-content/uploads/2011/11/Files.png"><img class="alignnone size-full wp-image-1206" title="Files" src="http://webdesignergeeks.com/wp-content/uploads/2011/11/Files.png" alt="Files" width="486" height="252" /></a></p>
<p><center><a class="super button blue" href="http://www.webdesignergeeks.com/tuts/Download/ajax_search.zip" rel="novollow"><strong>Download</strong></a></center></p>
<p>First of all create database <strong>ajax_demo , </strong>then create table <strong>ajax_search.</strong></p>
<pre name="code" class="html">CREATE TABLE `ajax_search` (
  `id` int(11) NOT NULL auto_increment,
  `FirstName` varchar(50) NOT NULL,
  `LastName` varchar(50) NOT NULL,
  `Age` int(11) NOT NULL,
  `Hometown` varchar(50) NOT NULL,
  `Job` varchar(50) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;</pre>
<h2>HTML Code: index.php</h2>
<pre name="code" class="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head&gt;

&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;

&lt;title&gt;Ajax Tutorial: How to Create Ajax Search Using PHP jQuery and MYSQL.  Demos: 99Points.info&lt;/title&gt;

&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"&gt;&lt;/script&gt;

&lt;link rel="stylesheet" type="text/css" media="screen" href="css.css" /&gt;

&lt;/head&gt;

&lt;script language="javascript"&gt;

$(document).ready(function(){

	//show loading bar

	function showLoader(){

		$('.search-background').fadeIn(200);

	}

	//hide loading bar

	function hideLoader(){

		$('#sub_cont').fadeIn(1500);

		$('.search-background').fadeOut(200);

	};

	$('#search').keyup(function(e) {

      if(e.keyCode == 13) {

      	showLoader();

		$('#sub_cont').fadeIn(1500);

		$("#content #sub_cont").load("search.php?val=" + $("#search").val(), hideLoader());

      }

      });

	$(".searchBtn").click(function(){

		//show the loading bar

		showLoader();

		$('#sub_cont').fadeIn(1500);
		$("#content #sub_cont").load("search.php?val=" + $("#search").val(), hideLoader());
	});

});

&lt;/script&gt;

&lt;body&gt;

&lt;h1&gt;Ajax Tutorial: How to Create Ajax Search Using PHP jQuery and MYSQL&lt;/h1&gt;

	&lt;div class="textBox"&gt;

        &lt;input type="text" value="" maxlength="100" name="searchBox" id="search"&gt;

		&lt;div class="searchBtn"&gt;

		&amp;nbsp;

		&lt;/div&gt;

    &lt;/div&gt;

	&lt;br clear="all" /&gt;

	&lt;div id="content"&gt;

		&lt;div class="search-background"&gt;

			&lt;label&gt;&lt;img src="loader.gif" alt="" /&gt;&lt;/label&gt;

		&lt;/div&gt;

		&lt;div id="sub_cont"&gt;

		&lt;/div&gt;

	&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<h2>DB Connect : dbcon.php</h2>
<pre name="code" class="html">&lt;?php

	$link = mysql_connect('localhost', 'root', '');

	mysql_select_db('ajax_demo',$link);
?&gt;</pre>
<h2>PHP Code for Search Result : search.php</h2>
<pre name="code" class="html">&lt;?php

function checkValues($value)
{
	 // Use this function on all those values where you want to check for both sql injection and cross site scripting
	 //Trim the value
	 $value = trim($value);

	// Stripslashes
	if (get_magic_quotes_gpc()) {
		$value = stripslashes($value);
	}

	 // Convert all &amp;lt;, &amp;gt; etc. to normal html and then strip these
	 $value = strtr($value,array_flip(get_html_translation_table(HTML_ENTITIES)));

	 // Strip HTML Tags
	 $value = strip_tags($value);

	// Quote the value
	$value = mysql_real_escape_string($value);
	return $value;

}
include("dbcon.php");

$rec = checkValues($_REQUEST['val']);
//get table contents

if($rec)
{
	$sql = "select * from ajax_search where FirstName like '%$rec%' or LastName like '%$rec%' or Age like '%$rec%' or Hometown like '%$rec%'";
	}

else

{
	$sql = "select * from ajax_search";
}

$rsd = mysql_query($sql);
$total =  mysql_num_rows($rsd);

?&gt;

&lt;?php
echo "&lt;h2&gt;Search Result&lt;/h2&gt;";
echo "&lt;table border='0'  id='content' cellspacing='0' cellpadding='0'&gt;
&lt;tr bgcolor='#FFFFCC'&gt;
&lt;th&gt;Firstname&lt;/th&gt;
&lt;th&gt;Lastname&lt;/th&gt;
&lt;th&gt;Age&lt;/th&gt;
&lt;th&gt;Hometown&lt;/th&gt;
&lt;th&gt;Job&lt;/th&gt;
&lt;/tr&gt;";
while ($row = mysql_fetch_assoc($rsd))

{
  echo "&lt;tr class='each_rec'&gt;";
  echo "&lt;td&gt;" . $row['FirstName'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['LastName'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['Age'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['Hometown'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['Job'] . "&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
echo "&lt;/table&gt;";

if($total==0){ echo '&lt;div class="no-rec"&gt;No Record Found !&lt;/div&gt;';}?&gt;</pre>
<p><center><a class="super button blue" href="http://www.webdesignergeeks.com/tuts/Download/ajax_search.zip" rel="novollow"><strong>Download</strong></a></center></p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="vas_pro_2"><div style="float:left; width:100px; " class="vas_pro_2_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebdesignergeeks.com%2Fcoding%2Fajax-js%2Fcreate-ajax-search-using-php-mysql-and-jquery%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="vas_pro_2_google1"> 
				<g:plusone size="medium" href="http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="vas_pro_2_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Create Ajax Search Using PHP MYSQL and jQuery" data-url="http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.24wn.com">news and information</a><a href="http://www.forum1000.com">business,health,entertainment,technology</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div><p>Related posts:</p><ol>
<li><a href='http://webdesignergeeks.com/cms/wordpress/create-simple-wordpress-plugin-from-scratch-part-2/' rel='bookmark' title='Create simple  wordpress plugin From Scratch Part-2'>Create simple  wordpress plugin From Scratch Part-2</a></li>
<li><a href='http://webdesignergeeks.com/tutorials/jquery/top-10-jquery-tutorials-you-should-know/' rel='bookmark' title='Top 10 Jquery Tutorials you should know'>Top 10 Jquery Tutorials you should know</a></li>
<li><a href='http://webdesignergeeks.com/cms/wordpress/create-simple-wordpress-plugin-from-scratch/' rel='bookmark' title='Create simple  wordpress plugin From Scratch Part-1'>Create simple  wordpress plugin From Scratch Part-1</a></li>
</ol><p>The post <a href="http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/">Create Ajax Search Using PHP MYSQL and jQuery</a> appeared first on <a href="http://webdesignergeeks.com">WebDesignerGeeks - Web Designer, Web Developer blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://webdesignergeeks.com/coding/ajax-js/create-ajax-search-using-php-mysql-and-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
