Basic Keyword Research & Application

I’ve told myself I’m not going to write about SEO in my blog posts, but perhaps I should just say I won’t be making any serious efforts to write as an authority converning SEO Services. It’s evolving and there are plenty of dedicated SEO Experts out there producing quality information about the subject.

However, from time to time I produce something I can share and with this blog post, I would like to share some basic research pages that allow you to creatively gather keyword data, for your consideration. I’ve kinda left the organization of data and the creative thought processes involved in using these tools, but I’ve squeezed the basic principle into an 11 minute video.

The quick of this data analysis is; is your keyword producing enough traffic to do something with? Are there so many existing pages in the Google search results that it’s even possible for you to obtain those keywords? Have you chosen the best possible set of keywords and their long tail counterparts to realistically make a go for it?

Basic Keyword Research Tools:

Google AdWords Traffic Estimator
Google Keyword Tool
Google

You might want to find your own keyword density tool, as the site in this video might be outdated or obsolete in the future, but the Google Tools should always be available.

The webJestic Engine Project

I’ve already gotten a head-start on a PHP application engine. I’ve created a Google Code project for it and initialized the SVN trunk with a check-in. As it is right now, it’s a basic Zend Framework shell with an inherited Smarty object to manage templates. There isn’t much to it at the moment, but the template engine is doing it’s thing.

The project will of course be following the phpDocumentor comment and code standards, and taking advantage of the // TODO: commenting practices used in PHP for Eclipse.

I still have a pretty tight schedule, but I’ve already begun planning out content and development.

Delphi for PHP (my verdict)

After having used Delphi for PHP to build an application framework, I managed to figure a lot of things out. I had to dig into the VCL and make some changes, search through tons of useless online documentation, and build and rebuild to finally get something I felt was fluid and sensible.

I’ve been a Delphi application developer since version 1, and I’ve grown with Delphi and it’s IDE and development style over the years. I’ve created dozens of custom components, taken advantage of it’s undocumented objects, and became involved with the Open Tools API.

I believe Delphi can be used to write some extremely poor applications, and I know it can be used to create some very slick applications as well. It’s all in the architecture and the developer who writes the code. Events can be elegant or nasty, depending on the experience the developer has with the IDE.

I tried to follow good practices in the Delphi for PHP environment. I’m not a fan of data-aware development in either Delphi environment, but I played with the technology in Delphi for PHP. I followed the rules, studied the code, and created some applications that took advantage of the templates, libraries, and it’s AJAX architecture.

After some very simple and mildly complex applications, written the way I believe Delphi for PHP was intended to be used, I gave up on it. Ignoring the weight of the VCL and just trying to make a decent application with an open mind (and some high hopes), I just couldn’t keep my code simple and elegant. I also couldn’t consistently produce XHTML/CSS code that remained W3C compliant or validated.




The future of Delphi for PHP is always in question when you are determining the direction of an application. Will it be supported in 5 years? Will they improve it? Can it even be improved? Will the VCL stand the test of time? Will there be a pool of developers to draw from when it comes time to hire an employee?

I just cannot believe it has a bright future as a commercial development environment, especially when there is an entire force of PHP developers openly improving upon Eclipse for PHP. With that said, I could in no way recommend a client begin new development with this product. In my opinion, they would eventually be stuck with a heavy weight application that can’t meet W3C standards, has outdated and neglected libraries, and frowned upon my any respectable PHP developer.

This is where I stand with Delphi for PHP and will no longer be creating articles or videos in the Delphi for PHP IDE.

I will however, be contributing content to PHP application development using Zend Servers and Eclipse for PHP, as well as some of the Zend Framework.

Back from China

For those of you who are unaware, I’ve been in China for a little more than a year. However, I’m back in the good ol’ United States now and have time to play with my hobby sites again.

I apologize to everyone who’s been waiting for me, it seems there has been a fair amount of activity for this site ( although I thought it would be dead and silent by now ).

I’m still heavily involved in web development using PHP and I fully intend to update my content and get things rolling again, as it’s not only fun for me, it’s always interesting to go back in time and see what I was doing.

I plan to begin updating my home page and my templates page this week.

Thanks for all the kind words and emails, I really appreciate it.

Michael

Database Designs: MySQL NULL Fields

Does your table designs support NULL values?

There is a debate about creating tables which permit NULL values. I personally make every effort to make every field in a table NOT NULL. The argument for this: I want to be able to depend on my SQL statements. In this post I will illustrate how an insignificant field that allows NULL values can create an issue. This is a simple illustration. More complex queries can break down as easily where NULL values are allowed.

It’s in my opinion, that NULL fields should be a topic for discussion, when you begin talking about your designs and the integrity behind those designs.

Example: NULL fields are allowed.

  1. CREATE TABLE SECURITY_USERS (
  2.        SECURITY_USER_ID Integer NOT NULL,
  3.        USER_NAME Varchar(30) NOT NULL,
  4.        FIRST_NAME Varchar(20),
  5.        LAST_NAME Varchar(20),
  6.        MIDDLE_INITIAL Varchar(1),
  7.  
  8.        CONSTRAINT PK_SECURITY_USERS PRIMARY KEY (SECURITY_USER_ID),
  9.        CONSTRAINT UNQ_SECURITY_USERS_USER_NAME UNIQUE (USER_NAME)
  10. ) TYPE=InnoDB DEFAULT CHARSET=utf8;

There are several things wrong with this table, but for the moment I would like to simply use it as an example of a table that supports NULL values. There are plenty of other fields in this table, but I’ve removed them for the sake of this post. They all permit NULL values.

In my opinion, the problem with this style design is that “I can’t always depend on my queries to produce good results“. Most of the time the system has entered in FIRST_NAME and LAST_NAME into the table and sometimes but not always, they entered a MIDDLE_INITIAL.

So, if we have two users in the system and the data looks like this:

Example: Sample data.

  1. /*
  2. SECURITY_USER_ID  |  USER_NAME  |  LAST_NAME  |  FIRST_NAME  |  MIDDLE_INITIAL
  3. 1                    admin         Master        Web            (NULL)
  4. 2                    jdoe          Doe           John            B
  5. */

…and one of them has a middle initial, while the other does not. Then this creates the potential for unpredictable results in advanced queries.

Example: SQL Statement.

  1. SELECT concat(LAST_NAME, ‘, ‘, FIRST_NAME, ‘ ‘, MIDDLE_INITIAL) AS FULL_NAME
  2. FROM security_users WHERE security_user_id = 1 OR security_user_id = 2

All I want to do is concatenate the users name in SQL, so it displays in the format of my choice without my having to do it in code. Sometimes, it’s nice to bring back data in the format you want. Besides, if I execute this query in more than one place in my application I don’t want to have to continue formatting it in code. I just like to have the query do it.

The problem is, when NULL fields are allowed, you cannot depend on good results. Especially if I built my query and was testing it with people who had middle names. The first time the query came across someone who had a NULL middle name in the application, the application would receive unexpected results.

Example: Query Results

  1. /*
  2. FULL_NAME
  3. (NULL)
  4. Doe, John B
  5. */

Despite the fact there is data in FIRST_NAME (= Web) and LAST_NAME (= Master), the returned result is still NULL. The MySQL concat() function failed to return the proper results, because MIDDLE_INITIAL contains a NULL value.

Using simple straight forward SQL statements failed, due to a NULL field in MIDDLE_INITIAL. This is a visual example; something we can see in a result window. However, if I had a more complicated query and was using a NULL field in a JOIN, then the problem isn’t as interesting. The problem can even become frustrating.

Example: NOT NULL table redesign (following the data structure)

  1. CREATE TABLE security_users (
  2.      id bigint(20) NOT NULL AUTO_INCREMENT,
  3.      user_name varchar(30) NOT NULL,
  4.      user_first_name varchar(20) NOT NULL,
  5.      user_last_name varchar(20) NOT NULL,
  6.      user_middle_initial varchar(1) NOT NULL DEFAULT ,
  7.  
  8.      UNIQUE KEY user_name (user_name),
  9.      PRIMARY KEY (id)
  10. ) TYPE=InnoDB DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1000;

In this table, MIDDLE_INITIAL has a value, even if the value is empty. An empty value is not the same as NULL and the results would return as I might expect them. The query in this post would execute properly and return the right results.