Directories that rank high in the SERPS for a certain keyword provide not only targetted traffic but also a quality relevent backlink. This is the kind of links Google recommands in its guidelines. So If you want to submit your real estate related website, instead of choosing the directory with highest PR, you should choose the directory that ranks best for that specific keyword.

I used the Google custom search to restrict the search on directories. So far 1277 directories are listed.
Strongest Directories for the Shopping Niche
Strongest Directories for the Real Estate Niche
Strongest Directories for the Jewelry Niche
Strongest Directories for the Celebrities Niche

You can do this search for any keyword you are targetting using the
Directories Link Quality Search: http://tools.enquira.com/link-quality.php

Your feedback is appreciated.

September 13th, 2007Cron job for database backup

This cron job allows you make automatic backups of your database and delete the backup files older than 7 days. You can set the backups to occur daily and use the following command for the cron:

cd BACKUPS_PATH; /usr/bin/mysqldump --opt -u DBUSER -pPASSWD DBNAME | gzip > DBNAME_`date "+%Y%m%d"`.sql.gz ; /usr/bin/find *.gz -mtime +7 | xargs /bin/rm -f

You should replace DBUSER, PASSWD, DBNAME with their respective values. Also BACKUPS_PATH should be replaced by the folder where you want to store your backup files (/home/yourdomain/public_html/backups or /var/www/vhosts/backups, …)

There is no space between -p and PASSWD.

Some time we have to collect last 7 or 15 days or X days (or month, year or week) data from MySQL table. For example let us find out who are the new members joined in our forum in last week. One shop may be interested in knowing new products added in last one month. What are the books arrived in last one year. Here irrespective of the date values we want the records of last X days from today, or we can say that the records between today and last X days ( month , year or week) are required.

We will use the MySQL function CURDATE() to get the today’s date.

To get the difference in today date and previous day or month we have to use the MySQL function DATE_SUB

DATE_SUB is a MySQL function which takes date expression, the interval and the constant to return the date value for further calculation.

Here are some sample queries on how to get the records as per requirements .

select * from dt_tb where `dt` >= DATE_SUB(CURDATE(), INTERVAL 15 DAY)

The above query will return last 15 days records. Note that this query will return all future dates also. To exclude future dates we have to modify the above command a little by using between query to get records. Here is the modified one.

SELECT * FROM dt_tb WHERE `dt` BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 15 DAY ) AND CURDATE( )

Let us try to get records added in last one month

select * from dt_tb where `dt` >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)

Here also future records will be returned so we can take care of that by using BETWEEN commands if required.

select * from dt_tb where `dt` >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR)

You can easily make out what the above query will return.

We can collect records between a particular date ranges by using between command and DATE_SUB. Here are some queries to generate records between two date ranges.

select * from dt_tb where `dt` BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 3 MONTH ) AND DATE_SUB( CURDATE( ) ,INTERVAL 0 MONTH )

This query will return records between last three months. This query again we will modify to get the records between three moths and six months.

select * from dt_tb where `dt` BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 6 MONTH ) AND DATE_SUB( CURDATE( ) ,INTERVAL 3 MONTH )

Now let us change this to get records between 6 month and 12 month.

select * from dt_tb where `dt` BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 12 MONTH ) AND DATE_SUB( CURDATE( ) ,INTERVAL 6 MONTH )

With this you can understand how the records between a month range or a year range can be collected from a table. Note that the months ranges are calculated starting from current day. So if we are collecting records of last three months and we are in 15th day of 9th month then records of 15th day of 6th month we will get but the records of 14th day of 6th month will be returning on next query that is between 3 months and 6 months.

Now let us try a different requirement. How to get the records of the working days of the week so far ? If today is Thursday then records from Monday to Thursday should be returned. We will discuss this in our next section >>.

Here is the sql code to create and fill the table with records

CREATE TABLE `dt_tb` ( `id` int(2) NOT NULL auto_increment, `dt` datetime NOT NULL default ‘0000-00-00 00:00:00′, `dt2` date NOT NULL default ‘0000-00-00′, UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

INSERT INTO `dt_tb` VALUES (1, ‘2007-02-15 00:00:00′, ‘2005-01-25′);
INSERT INTO `dt_tb` VALUES (2, ‘2007-02-12 23:56:54′, ‘2005-06-12′);
INSERT INTO `dt_tb` VALUES (3, ‘2005-12-08 13:20:10′, ‘2005-06-06′);
INSERT INTO `dt_tb` VALUES (5, ‘2005-02-10 00:00:00′, ‘2006-01-02′);
INSERT INTO `dt_tb` VALUES (6, ‘2006-11-26 00:00:00′, ‘2006-12-25′);
INSERT INTO `dt_tb` VALUES (7, ‘2006-11-26 00:00:00′, ‘2007-02-25′);
INSERT INTO `dt_tb` VALUES (8, ‘2007-10-20 00:00:00′, ‘2007-10-25′);
INSERT INTO `dt_tb` VALUES (9, ‘2007-02-11 00:00:00′, ‘2007-01-25′);
INSERT INTO `dt_tb` VALUES (10, ‘2007-01-22 00:00:00′, ‘2007-01-15′);

Source: plus2net


© 2007 rakCha resources | Powered by Wordpress | rakCha web directory