I have a a table in my database where I store categories for newsarticles and each time a user reads an article it increments the value in the associated column. Like this:<
PL/SQL, maybe? Set user_id, query your table, store the returned row in an nx2 array of column names and values (where n is the number of columns) and sort the array based on the values.
Of course, the correct thing to do is redesign your database in the manner that @octern suggests.