in reply to Building a tag cloud from a database

Depending on the database, you could do this:
SELECT word, occurrences FROM statistic ORDER BY occurrences DESC LIMI +T 200
Also, most databases will provide some amount of mathematical functioning for you and, in some cases, it can be much more efficient. Just make sure you comment the heck out of the SQL.

And, the last problem is:

$dbtags{$word} = $occurrences;

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Building a tag cloud from a database
by jdporter (Paladin) on Apr 29, 2008 at 13:46 UTC
    Just make sure you comment the heck out of the SQL.

    Better yet, don't put the heck in your SQL in the first place. It would only confuse those who have to maintain the code later.

    ;-)
      Not if you hire a heckler