+6  A: 

Members:

id    (autoinc)
name
password
theme_id

Posts:

id    (autoinc)
member_id
title
date

Tags:

id    (autoinc)
name

Tag_Relations:

tag_id
post_id

Posts is your "array" of posts, with the member_id column linking each post to its user. Tags is your "array" of tags, Tag Relations links each tag to one or more posts.

Here is an example of how you could get all posts & tags for a user with one query:

SELECT Members.name, Posts.title, Tag_Relations.item_id, Tags.name 
FROM Members LEFT 
JOIN Posts ON Members.id = Posts.member_id 
LEFT JOIN Tag_Relations ON Tag_Relations.post_id = Posts.id 
LEFT JOIN Tags ON Tags.id = Tag_Relations.tag_id 
WHERE Members.id = 2779;

+----------+-----------------------------------+------------+---------+
| name     | title                             | item_recid | name    |
+----------+-----------------------------------+------------+---------+
| Mike     | One Post's Title                  |        973 | Houses! | 
| Mike     | One Post's Title                  |        973 | Cars    | 
| Mike     | One Post's Title                  |        973 | Hats    | 
| Mike     | Another Post's Title              |        973 | Cars    | 
| Mike     | Yet another post                  |        975 | Homes   | 
| Mike     | Guess what?!                      |        976 | Houses! | 
| Mike     | Another one :)                    |        977 | Noses   | 
| Mike     | Another one :)                    |        977 | Mouth   | 
| Mike     | Another one :)                    |        977 | Head    | 
| Mike     | Another one :)                    |        977 | Knees   | 
+----------+-----------------------------------+------------+---------+
Michael Robinson
That seems horribly inefficient. Ignoring the wasted space you have the processing problem of requiring a search. To simply display the say 4 posts of one user I must search through the thousands of posts by all users to find those 4 posts? AND for each tag on each post (say 4 each) I need to search through another array?
Idiomatic
You don't 'search' through the records, you use the id's to efficiently select the records you need. There is no duplication of data, where is the wasted space?
Michael Robinson
Well there is wasted space compared to the footprint of the OOP structure due to the repeating of IDs but I guess it isn't much. After reading a bit about SQL I realized how efficient the select command is so that isn't as big a deal as I originally thought. Thanks for the answer and the further clarification!
Idiomatic
It's efficient, so long as indexes / keys are used properly :) Improper use of them can result in hilarious query execution times... Happy to help :)
Michael Robinson
Got all that working properly :D. Wondering if you had any suggestions for tools for web programming. Atm I'm just using notepad++ and whatever good programming practices I know from my background (java/c++). But my total non-use of testing aps or debugging software or something to test efficiency. Even if I can get things working who knows how well they'll hold up in bad situations or heavy load w/e... I feel a tad naked as the project grows.
Idiomatic
Uh, I use Eclipse PDT and work with PHP, Javascript (Prototype library) and MySQL. For MySQL I use either the MySQL CLI or phpMyAdmin. For in-browser debugging and styles testing I use a combination of Firebug, Web Developer Toolbar and Mac OS X's Digital Colour Meter. For MySQL query efficiency, if I think a query is too slow I'll test it manually and tweak it, also I use mysql_log_slow_queries set to log queries taking more than 2 seconds. Happy programming!
Michael Robinson
+1  A: 

Learn about normal forms (several good tutorials online including this one). Database engines are extremely efficient in doing JOIN operations between flat tables that have been indexed appropriately.

The basic idea is that you identify the entities in your database (e.g. the users/posts/themes you mentioned), and the relations between them (one-to-one, one-to-many, or many-to-many). This allows you to split your data up into flat tables which can be efficiently reassembled.

Jason S