<?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>SEOAnalytic.com official blog &#187; PHP and MySQL</title>
	<atom:link href="http://seoanalytic.com/blog/category/php-and-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://seoanalytic.com/blog</link>
	<description>My thoughts about SEO, programming and life maybe ;)</description>
	<lastBuildDate>Mon, 20 Apr 2009 05:41:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Best programming IDEs in Ubuntu (php,javascript,css,python,java)</title>
		<link>http://seoanalytic.com/blog/210/best-programming-ides-in-ubuntu-phpjavascriptcsspythonjava/</link>
		<comments>http://seoanalytic.com/blog/210/best-programming-ides-in-ubuntu-phpjavascriptcsspythonjava/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 05:41:14 +0000</pubDate>
		<dc:creator>Dragos</dc:creator>
				<category><![CDATA[PHP and MySQL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ide]]></category>

		<guid isPermaLink="false">http://seoanalytic.com/blog/?p=210</guid>
		<description><![CDATA[Here are some of the IDEs that i have tried and I liked.
Geany &#8211; simple editor, loads fast, has interesting features like code completion, syntax highlighting. Works well with Python 3
NetBeans &#8211; very good IDE. I am using it currently to develop a sophisticated website. Works well wit large projects. Drawback: no word-wrapping feature.
CodeBlocks &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some of the IDEs that i have tried and I liked.</p>
<p><a href="http://geany.org">Geany</a> &#8211; simple editor, loads fast, has interesting features like code completion, syntax highlighting. Works well with Python 3</p>
<p><a href="http://netbeans.org">NetBeans</a> &#8211; very good IDE. I am using it currently to develop a sophisticated website. Works well wit large projects. Drawback: no word-wrapping feature.</p>
<p><a href="http://codeblocks.org">CodeBlocks</a> &#8211; I am using it for C,C++ projects at school. Very good IDE, with a simple and intuitive interface. It has syntax highlighting, code completion and fast compiler.</p>
<p><a href="http://ubuntu.com">GEdit</a> &#8211; default text editor in Ubuntu. Works with any type of code. Best for fast code corrections.</p>
]]></content:encoded>
			<wfw:commentRss>http://seoanalytic.com/blog/210/best-programming-ides-in-ubuntu-phpjavascriptcsspythonjava/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Apache+MySQL+PHP+FTP web server package</title>
		<link>http://seoanalytic.com/blog/130/best-apachemysqlphpftp-web-server-package/</link>
		<comments>http://seoanalytic.com/blog/130/best-apachemysqlphpftp-web-server-package/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 14:51:15 +0000</pubDate>
		<dc:creator>Dragos</dc:creator>
				<category><![CDATA[PHP and MySQL]]></category>
		<category><![CDATA[apache php mysql on windows]]></category>
		<category><![CDATA[web server distribution]]></category>
		<category><![CDATA[web server package]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://seoanalytic.com/blog/?p=130</guid>
		<description><![CDATA[


As any other web developer, before uploading something functional to a remote server, first of all i need to test my work on my computer, right? I&#8217;ve tried many packages like TopServer (not supported any more), STPServer, EasyPHP, but from all that i tried i stuck with Xampp.
XAMPP is an easy to install distribution of [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left">
<img border="0" src="http://www.apachefriends.org/images/211.jpg" />
</div>
<p>As any other web developer, before uploading something functional to a remote server, first of all i need to test my work on my computer, right? I&#8217;ve tried many packages like TopServer (not supported any more), <a href="http://www.stpserver.ru/remository.html?func=fileinfo&amp;id=8">STPServer</a>, <a href="http://www.easyphp.org/">EasyPHP</a>, but from all that i tried i stuck with Xampp.</p>
<p><a href="http://www.apachefriends.org/en/index.html">XAMPP</a> is an easy to install distribution of Apache+MySQL+PHP+FTP+some more additional things, which comes in a single installation file. What i liked most of it, it is the fact it is updated as fast as an update to PHP,Apache or MySQL is available, so i always test my works with the latest versions of these components.  Then, this distribution has a very well built manager which lets you easily start or stop any of the services you want (apache/mysql/filezilla/mercury) with a single click, so there is no more need to play with the comand line. Then, it has a good application,Mercury, which lets you test your works which make use of the mail() function like in real time. Most of the time i do my work in Windows (because i need to work with Photoshop also), but when i want to work in Linux Ubuntu i easily start LAMPP (the Linux distribution, which you can download from the same site) and work like in windows. In my opinion this is the best distribution of Apache+MySQL+PHP+FTP of all currently available on the net because of its flexibility and frequent updates. You may search on Google and see how many share my idea and if you are looking for a web server package start with this one.</p>
<p>Official XAMPP/LAMPP website: http://www.apachefriends.org/</p>
]]></content:encoded>
			<wfw:commentRss>http://seoanalytic.com/blog/130/best-apachemysqlphpftp-web-server-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP MySQL search class script</title>
		<link>http://seoanalytic.com/blog/55/php-mysql-search-class-script/</link>
		<comments>http://seoanalytic.com/blog/55/php-mysql-search-class-script/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 15:42:01 +0000</pubDate>
		<dc:creator>Dragos</dc:creator>
				<category><![CDATA[PHP and MySQL]]></category>
		<category><![CDATA[php mysql search]]></category>
		<category><![CDATA[php mysql search class]]></category>
		<category><![CDATA[search script]]></category>

		<guid isPermaLink="false">http://seoanalytic.com/blog/?p=55</guid>
		<description><![CDATA[I am currently developing a website that needs a good script to search in the database. The basic MySQL function LIKE doesn&#8217;t return some good results and because i didn&#8217;t want to go deeper with mysql with its regex i started to create my own script to search in a mysql database, actually it is [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently developing a website that needs a good script to search in the database. The basic MySQL function <strong>LIKE</strong> doesn&#8217;t return some good results and because i didn&#8217;t want to go deeper with mysql with its regex i started to create my own script to search in a mysql database, actually it is a class, my first class ever written <img src='http://seoanalytic.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .<br />
So here it is:</p>
<pre lang="php">class PHP_MySQL_search {
/*
		Copyright 2008 Mocrii Dragos.
		To understand how this class works and what you need to do in order to use it, go to http://seoanalytic.com/blog/55/php-mysql-search-class-script/
*/
function setDBdetails($host,$usr,$pwd) { //set database details
	$this->HOST=$host;
	$this->USR=$usr;
	$this->PWD=$pwd;
}

function DBselect($db) { //set database to work with
	$this->db=$db;
}
function setTable($table) { //set table(s) to search in
	$this->table=$table;
}
function setID($id) { //select the identifier of your rows. Usually it is id
	$this->ID=$id;
}
function setColumns($cols) { //set the columns to search in
	$this->columns=$cols;
}
function setOrderBy($orderby) { //this is how data will be retrieved from the database. This is not how results will be displayed.
	$this->OrderBy=$orderby;
}
function setLimit($num) { //set the limit of results per page
	$this->Limit=(int)$num;
}
function setBegin($num) { //set the start row. Starting with this row results will be retrieved until limit has been reached.
	$this->BeginFrom=(int)$num;
}
function nin_array($val) { //filter arrays from common words. You may add your own.
$filtered=array('that','with','they','have','this','from','some','what','which','each','then','when','only','because');
return (strlen($val)>3 &#038;&#038; !in_array(strtolower($val),$filtered));
}
function find($kp) { //this will search and return the result array
$kp=trim(strip_tags(urldecode($kp)));
$matches=array('\'','"','/','.',',','`','!','?','@','%','_','*','[',']','{','}','$'); //filter from punctuation signs. only plain text is needed
$replacements='';
$kp=str_replace($matches,$replacements,$kp); //This will filter unwanted chars
$kp=preg_replace('/\s\s+/', ' ', $kp); //This will filter excess whitespace
$kpa=explode(' ',$kp);
$kpa=array_filter($kpa,array($this,"nin_array"));
if(!$this->BeginFrom || $this->BeginFrom=='') $this->BeginFrom=0;
if(!$this->Limit || $this->Limit=='') $this->Limit=10;
if(!$this->columns || $this->columns=='') {
	$this->columns="*";
	$build_query="SELECT ".$this->columns." FROM ".$this->table.($this->OrderBy!=''?" ORDER BY ".$this->OrderBy:"")." LIMIT ".$this->BeginFrom.",18446744073709551615";
}
else {
	$build_query="SELECT ".$this->ID.",".$this->columns." FROM ".$this->table.($this->OrderBy!=''?" ORDER BY ".$this->OrderBy:"")." LIMIT ".$this->BeginFrom.",18446744073709551615"; //the big number is used to select all rows from limit to the end of the table. if you have more than 18446744073709551615 rows in your table, change this number to a bigger one <img src='http://seoanalytic.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
}
$con=mysql_connect($this->HOST,$this->USR,$this->PWD);
if(!$con || !mysql_select_db($this->db)) return false;
$my_query=mysql_query($build_query,$con);
//echo mysql_num_rows($my_query);
$results=array(); //echo $build_query;
$kontor=0;
$kontor2=0;
while($row=mysql_fetch_array($my_query,MYSQL_ASSOC)) {
	$kontor2++;
	$row=array_map('stripslashes',$row);
	$tmp=implode(' ',$row);
	$matches=array('\'','"','/','.',',','`','!','?','@','%','_','*','[',']','{','}','$');
	$replacements='';
	$tmp=trim(strip_tags($tmp));
	$tmp=str_replace($matches,$replacements,$tmp); //This will filter unwanted chars
	$tmp=preg_replace('/\s\s+/', ' ', $tmp); //This will filter excess whitespace
	$tmpa=explode(' ',$tmp);
	$tmpa=array_filter($tmpa,array($this,"nin_array"));
	$tmpa=array_map("strtolower",$tmpa);
	for($i=0;$i<count($kpa);$i++) $found[$kpa[$i]]=0;
	$found2=false;
	foreach($tmpa as $kke) {

		foreach($kpa as $kpp) {
			if(abs(strlen($kke)-strlen($kpp))<=2 &#038;&#038; (substr($kke,0,strlen($kpp))==$kpp || substr($kpp,0,strlen($kke))==$kke))  { $found2=true; $found[$kpp]++; }
		}

	}

	if($found2===true) { $bld=array("kwds"=>$found,"res"=>$row); array_push($results,$bld); $kontor++;}
	if($kontor>=$this->Limit) break; //if limit has been reached then break out of the while cycle
}
mysql_close($con);
return $results;
}

}
</pre>
<p>To use it you need to set some details. Here is an example of its use:</p>
<pre lang="php">
        $msearch=new PHP_MySQL_search;
	$msearch->setDBdetails("localhost","root","secret_password"); //
	$msearch->DBselect("database_name");
	$msearch->setTable("table_name(s)");
	//$msearch->setOrderBy("id");
	$msearch->setID("id");
	$msearch->setBegin(0); // this will be used to form the <strong>SELECT</strong> query: <strong>limit 0,2</strong> , for example
	$msearch->setLimit(15); //this is the number of the results per page
	$msearch->setColumns("title,name,occupation"); //columns to search in. If you do not want to specify the columns then comment this line or set the value <strong>*</strong>
	$result_array= $msearch->find('keyword phrase')
        print_r(  $result_array );
</pre>
<p>The dump of $result_array will have the form:<br />
Array ( [0] => Array ( [kwds] => Array ( [keyword1] => 1, [keyword2]=> 5 ) [res] => Array ( [id] => 34 [title] => The title [content] => The content [summary] => This is about &#8230;) ) ) ,<br />
where the main array contains all results, the second one contains the exploded words of the keyword phrase and how many times each one was found + [res] contains an array with the results from the columns you specified, or all columns if you set the <strong>*</strong> value. If it is hard for you to understand my explanation, i bet it is, just try it yourself and analyze the output for at least 3 different keyword phrases.<br />
Any questions? Ask here.</p>
]]></content:encoded>
			<wfw:commentRss>http://seoanalytic.com/blog/55/php-mysql-search-class-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
