To add search functionality I decieded this was the best table structure I
could come up with for a  keywords table.

Here it is:

CREATE TABLE article_keyword (
  aid int(11) unsigned NOT NULL default '0',
  keyword char(50) NOT NULL default '',
  weight tinyint(2) unsigned NOT NULL default '0',
  PRIMARY KEY  (aid),
  KEY keyword (keyword),
  KEY aid (aid),
  KEY weight (weight)

Using that structure could I get a decent search?

I would probably add up the weight for each keyword(Where it is searched
for). Then sort it by the most 'relevent' then I could use a join to get the
title, time etc of the article and return the results.

What I am asking is that if this is a good table structure for something
like this(N00B alert!). If not could you please give me a better one?

JJ Harrison

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to