Search Marketing

   
   

Search Engine Marketing

A work-in-progress devoted to providing advice and techniques to better market your product or service. Subjects covered range from MySQL, PHP, SEO and technology Investing.

We use christonium.com to manage all our content because it is very flexible and allows many subject within Search Engine Marketing to be covered. Anyone can create a free social website on christonium.com. Site Map of Search Engine Marketing

Latest Article:

Subdomain or Directory – Which is Better for SEO?

Asus Eee PC 900 Laptop Review

MySQL INTO OUTFILE on Remote Machine

Fri Nov 06, 2009 8:01 pm
Comments: 0 Views: 24

Using your local machine to access a remote database server with INTO OUTFILE

If you have a database on a remote machine and want to use INTO OUTFILE to create a file with the output of the query and have it automatically sent to your local machine you might assume the following command would work:

mysql -u -p database_name -h -e"SELECT * FROM database.table INTO OUTFILE '/tmp/file.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY 'n'; "

Then once it gives you a problem you might assume that you did not set your remote MySQL permissions correctly.

So you add a grant permission for your remote user in MySQL, but it still does not work. Then you figure that your local machine has its permissions set improperly, so you fiddle around with those.

Solution: MySQL cannot write files on remote machines. As far as I am aware unless you have a MASTER/SLAVE setup MySQL never has the capability to write files on a remote machine.

"If you want to create the resulting file on some client host other than the server host, you cannot use SELECT ... INTO OUTFILE."
source: http://dev.mysql.com/doc/refman/5.0/en/select.html

You should notice that a command like:
mysql -u -p database_name -h -e"SELECT * FROM database.table"
will output the correct data to your local screen but it will not be formated, since the command basically mimics the local command line access screen.

The best way to handle this situation is to write a script in perl or php that adds tabs or space and creates the file and then scp's it to your local machine.



Matching Characters in a Text String with PHP

Thu Nov 05, 2009 6:58 pm
Comments: 0 Views: 15

If you have a block of text and want to match certain characters or words then mb_ereg_match() works great to find any instance or instances of the occurrence you are looking for.

There are an unbelieveable number of reasons you might want to find something in a block of text. Basically if you find something you can then change it. You could change the character of links, html, relative links to absolute links, change a's to b's or anything else. But first you need to find what you are looking for.

Using the following function you could find anything in a text block:

$string = "programming is good";

$match = "is";

$example = mb_ereg_match(".*$match", "$string");

The result would be true, because there is an "is" in the string.

Lets assume that in the example you want to make a note if any specific occurrences of "is" are found in the text.

if($example == 1) // 1,true 0, false
{
echo "there is a match in the string";
// then do - insert code
}

Note: The wildcard (*) character says to match anything in the string, but you may remove it to match more specific parts of the text block.



The Use and Relevance of Keyword Density

Tue Oct 27, 2009 11:53 pm
Comments: 0 Views: 100

If we look at how one would create a Search Engine we might find out how they must operate, or even how they could be improved. As much as it might appear that Search Engine results are mysterious, they can be broken down to their component parts and understood. Once you add simple on top of simple you tend to get complex, and the whole system in operation can appear to be daunting. If we break it down to its components, processing power, storage capacity and specialty algorithms these all just become parts of a larger understandable system.

From the point of view of a Search Engine one of the easiest ways to evaluate a general array of web related documents for various factors would be to use a baseline to measure all others against.

For instance if we take keyword density. Look at some well known documents in literature, or newspaper articles, or magazine pieces. Wouldn't that standard, perhaps something written before the web era illustrate a natural level of keyword density for all other documents?

Using this technique you could easily eliminate as spam many documents that would fall outside the range of these general documents. Another possibility would be to take an article written without Optimization. A sample Wikipedia article could provide such a baseline.

The Wikipedia article about “Tennis” provides some indication of a keyword density for an encyclopedic entry on the web.

This document is 9141 words long. This includes all links and anything else on the page, not just the main article, since in evaluating a web document the source includes everything being displayed.

Term Keyword DensityTimes Occurring
Tennis 1.8%165
Court 0.6%
54
U.S. Open
  < 0.1%
9
Racquet
  < 0.1%5
Racket
  < 0.1%2

In looking at the Wikipedia "Tennis" article we determined the keywords from the title and general topics covered. Over all such an article is very broad, covering the whole subject in a lot of text.

The second "article" we looked at was Henry David Thoreau's "On the Duty of Civil Disobedience", or also called "Resistance to Civil Government". This essay is 9408 words long, and because it is pre-web writing (1849) there is no navigation or links included in the word count.

Term Keyword DensityTimes Occurring
State 0.6%61
Government0.62%
58
Slavery
0.12%
11
American
 < 0.1% 8
Civil
 < 0.1%6
Constitution < 0.1%6
Revolution
 < 0.1%6
Disobedience < 0.1%3

When you evaluate an older piece, like something from Thoreau you begin to realize the way modern documents are organized to reveal much smaller specific pieces of information. Essays like Civil Disobedience are relatively long and were not designed for web usage and these essays were frequently read aloud as persuasion pieces. Essays, like speeches in this sense are not search friendly, they have many ideas, but very few facts. This type of writing does not answer questions, it incites discussion. Even blogs which are generally not search friendly are very specific in nature.

The next piece we decided to look at in the pre-web era was something more akin to modern writing formats. This is the book review, written by Lance Morrow in 1976 for Time magazine analyzing two new books about the Soviet Union. At 1217 words it is more in line with a modern web piece than something from Thoreau.

The Inscrutable Soviets

Term Keyword DensityTimes Occurring
Russia 1.4%17
Soviet1%
13
America
0.2%
6
Moscow 0.4% 3

It is easy to see the keywords, as derived from the title or the article, as well as the titles of the books reviewed are used very infrequently relative to modern web specific promotion and short web pages.

Conclusion:

The web has forced a world in which documents must become smaller, more highly defined in order to be found by Search Engines and in turn by web users. Most people perform searches that require a specific answer.

  • The score of the latest game.
  • A date in history that refers to a specific event.
  • Product information about a small range of specific desires.

Basically, highly specific pages need to exist for a Search Engine to be able to properly answer the above queries. Keyword Density is a possible factor but as we can see from the above array of articles and web pages this is only one factor. And to determine how much of a factor depends on the situation, but over all it would be a very small one and by definition would not define, or help to define longer more conceptual documents such as Thoreau's "Resistance to Civil Government".

A Search Engine could certainly use Keyword Density as a factor, even a large factor if they wish but you might see that whatever density level you set for keyword phases they are rather arbitrary. Unless you could successfully segment content into Articles or Newspapers, Historic Literature or Product Literature you would not want to utilize the concept of Keyword Density, or it may be to the detriment of other types of information.




© 2009 Christonium LLC

Christonium.com
|
Terms of Use
|
Privacy