functionality question / opinions on change sought
ok. the question is if there's a function, either in sql or php, that will check for a specific table name and return true or false depending on if it exists or not.
for those that will be kind enough to give opinions/advice, i should mention what i have then go to why i'm asking the above question.
in order to bring my php knowledge current and show and increase my experience with sql, i created a db heavy site that started as a forums and built on otherthings including profiles and blogs. the blogs are done as one table right now. while this is fine when the site is small, it's obviously not scalable. so i want to move to each user having his/her own table, but that's going to create an immensly large overhead that's unnecessary since not all users will use the blogs.
i want to have a blog page that prompts a user to create their own blog if they don't have one but wants to have one, and lets others know the specified user has no blog if they don't have one. i've already figured out a way to name them all uniquely.
both username and user id number are unique/ i can create a blog and blog comment table that is based on one or both of those. i already figured out which feilds from the huge table i'll need and how to do the rest, just not ehe best way to tell who has one and who doesn't. if you have opinions on how to do the rest, i'm also interested in what that is and why since you may have thought of soemthing i haven't, and i may then be able to improve my design.
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
Suzanne posted this at 20:17 — 31st January 2004.
She has: 5,507 posts
Joined: Feb 2000
Does this meet what you need?
http://ca.php.net/manual/en/function.mysql-list-tables.php
If not, http://www.mysql.com/doc/en/CREATE_TABLE.html should suit your needs.
m3rajk posted this at 01:18 — 1st February 2004.
They have: 461 posts
Joined: Jul 2003
kewl
someome at a different forums suggested i rethink splittingot each user having their own table since it creates issues tryingto find the last past, posts today, etc.
so i have a question here. who thinks there's a better way to make it more scalable?
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
Mark Hensler posted this at 21:51 — 4th February 2004.
He has: 4,048 posts
Joined: Aug 2000
I don't like the idea of seperate tables for each person.
You may want to consider spliting the blog "headers" from the "body" (similar to email headers). The blog_headers table could be fully indexed and maybe even fixed length (If you don't have titles for your blogs, otherwise you'll be wasting space using a char datatype), which would search faster. Then the blog_body would contain an id and blob().
Right now, I would make a feature list...
Do you want to be able to pull stats from your data? (what kind? stats per user? blogs-per-[unit_of_time]? longest blog to date? most read blog? most commented blog?)
Should it be searchable? (titles too? by date ranges? by author?)
Should there be user comments? (searchable?)
If there are user comments, should there be a mechanism for the blogger to reply to a specific user comment? (like some guestbooks provide)
Is there a need for attachments? (stored in db or in filesystem? un/limited attachments per blog?)
Is there a need for bbcode or URL parsing?
Will this be template driven?
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.