I've been using my own custom coded PHP /MySQL content management system for various websites I have made, but I am starting to see the limitations and have begun a total rewrite for my next website.
I understand the basics of relational databases, but I can't seem to find an elegant way to store all this extra data:
For simplicity, lets say I only have two tables users (user_id, username, password) and posts (post_id, user_id, post). My database is much more complex, but I've got all the current relationships working in fairly elegant ways... except for the "extra" user stuff, where I use a catch all table user_data (user_id, variable, value) that store all of this data:
current/last visit to parts of the site (ex: ex: user_id: 1 / variable: last:about.php / 2003-05-23 20:40)
lists of read/unread posts
user votes (ex: user_id / vote_id / vote)
user settings (ex: user_id / ResultsPerPage / 30)
It seems like there should be an elegant way to make this happen, but I just can't seem to wrap my head around it... If anyone could provide some ideas I would be greatfull.