Jump to content

[SOLVED] Does my database structure look correct for a forum.


redarrow

Recommended Posts

Does my database structure look correct to you please.

 

it a very basic forum with  message system

users.

user_id
username
password
email
validated_digit
validated
secret_number
ip_address
timestamps

loin_attempts

loin_id
ip_address
attempts
note
timestamps

forums

forum_id
forum_name
forum_access
timestamps


forum_topics

topic_id
user_id
forum_name
topic_name
topic
solved
locked
timestamps

topic_reply

topic_reply_id
topic_id
user_id
forum_name
topic_reply
timestamps


topic_stats

topic_stats_id
topic_id
forum_name
topic_name
topic_stats
timestamps


user_messages_receive

user_messages_received_id
user_message_reply_id
user_id
topic_id
topic_name
forum_name
user_message
read
sent
timestamps

user_messages_sent

user_message_reply_id
user_message_received_id
user_id
topic_id
topic_name
forum_name
user_reply
read
replayed
timestamps

Link to comment
Share on other sites

create table user_messages_sent(
user_message_reply_id int auto_increment primary key,
user_message_receved_id int(10) not null,
userid int(10) not null,
topic_id int(10) not null,
topic_name text not null,
forum_name text not null,
user_reply text not null,
read varchar(3) not null,
replyed varchar(3) not null,
timestamp int(50) not null
);

 

line 9 mysql error that means line 8 there no fault is there.

user_reply text not null,

 

 

Link to comment
Share on other sites

create table user_messages_sent(
user_message_reply_id int auto_increment primary key,
user_message_receved_id int(10) not null,
userid int(10) not null,
topic_id int(10) not null,
topic_name text not null,
forum_name text not null,
user_reply text not null,
read varchar(3) not null,
replyed varchar(3) not null,
timestamp int(50) not null
);

 

line 9 mysql error that means line 8 there no fault is there.

user_reply text not null,

 

 

 

I don't see how this relates to our comments...  I don't really understand this comment either.

Link to comment
Share on other sites

redarrow you are crytpic.  I don't know what you're up to, but it scares me.

 

Hehe, I know!  redarrow are you sure your syntax is correct for creating these tables?  I looked up some basic tutorials they assign the primary key a different way along with some other things. 

 

What exactly is the error?

Link to comment
Share on other sites

a1.The current database needs the name ((forum_name)) as there going to be more then 1 forum.

 

a2. the database is normalized via the user_id look again.

 

 

I scare u because you dont read the correct books or web sites it all works.

 

 

 

 

database solved.....

create database forum_test;


use forum_test;


create table users(
user_id int auto_increment primary key,
username varchar(50) not null,
password int(70) not null,
email varchar(80) not null,
valadated_digit int(4) not null,
valadated int(2) not null,
secret_number int(4) not null,
ip_address int(20) not null,
timestamp int(50) not null
);


create table login_attemps(
login_id int auto_increment primary key,
ip_address int(20) not null,
attemps int(3) not null,
note text not null,
timestamp int(50) not null
);


create table forums(
forum_id int auto_increment primary key,
forum_name text not null,
forum_access varchar(5) default 'admin' not null,
timestamp int(50) not null
);



create table forum_topics(
topic_id int auto_increment primary key,
user_id int(10) not null,
forum_name text not null,
topic_name text not null,
topic text not null,
solved varchar(3) not null,
timestamp int(50) not null
);



create table topic_reply(
topic_reply_id int auto_increment primary key,
topic_id int(10) not null,
user_id int(10) not null,
forum_name text not null,
topic_reply text not null,
timestamp int(50) not null
);



create table topic_stats(
topic_stats_id int auto_increment primary key,
topic_id int(10) not null,
forum_name text not null,
topic_name text not null,
topic_stats int(10) not null,
timestamp int(50) not null
);


create table user_messages_receve(
user_messages_receved_id int auto_increment primary key,
user_message_reply_id int(10) not null,
user_id int(10) not null,
topic_id int(10) not null,
topic_name text not null,
forum_name text not null,
user_message text not null,
read_reply varchar(3) not null,
sent_reply varchar(3) not null,
timstamp int(50) not null
);

create table user_messages_sent(
user_message_reply_id int auto_increment primary key,
user_message_receved_id int(10) not null,
userid int(10) not null,
topic_id int(10) not null,
topic_name text not null,
forum_name text not null,
user_reply text not null,
read_reply varchar(3) not null,
replyed varchar(3)  not null,
timestamp int(50) not null
);

 

 

 

 

 

Link to comment
Share on other sites

You really do need to read more about relational database design.  With your current scheme, what if you want to change the name of a forum? Are you going to find every record in the database that references that forum name and update it?

 

Quickly looking over it, I think this is a much better design:

 

users
id
username
password
email
validated_digit
validated
secret_number
ip_address
created

login_attempts
id
user_id
ip_address
attempts
note
created

forums
id
name
access
created
modified

topics
id
forum_id
user_id
name
solved
locked
created
modified

replies
id
topic_id
user_id
body
created
modified

 

And this is example is not that great.  It would be much better to use pivot tables to relate users and topics, users and replies etc.

 

Forums have been done over and over and over.  Why not download simplemachines, phpBB, vanilla, or some other open source PHP forum and take a look at their database scheme?

Link to comment
Share on other sites

look i done the database of my head didn't even rely look, i will print it and get back

 

You should make sure the database is exactly how you want it because if not it's going to be very hard to change later.  I mean if you don't care, than that's a different story.  I would sit down draw all the relationships, FK's, PK's, and what makes sense.  Basically normalize the database.

 

I seriously don't know what it is redarrow, but your mystique awakens an inner fire.  I think I'm falling in love with you.

 

How cute...

Link to comment
Share on other sites

Look this is the i dear don't nick it lol...

 

I am creating a major forum, it going to be a forum that has meny forum within it self,

 

so lets say we wanted a programming forum it be a sub off another forum.

 

now you no and thanks for loving me lol.

 

And yes i will go throw the database with a comb

 

see the problam is your think arrrrrr one table links to another but not when it comes to

the admin tables there separate.

 

example

 

table forums has nothink to do with no one except admin.

 

 

 

 

 

 

 

Link to comment
Share on other sites

If joe blogs has 10 websites, and joe blogs wanted 1 forum on each web site that 10 forums..

 

That where i come in and give joe blogs a multi purpose forum script that can show

10 forums as 1 script.

 

Every forum created via the admin, will have the ability to design the colors and looks

of his 10 web sites from 1 script.

 

wait and see.

 

all it means is a user with load off websites can use 1 script instead off 10 example.

 

 

Link to comment
Share on other sites

Every forum created via the admin, will have the ability to design the colors and looks

of his 10 web sites from 1 script.

 

I highly doubt all that with 1 script... 

 

Why use your software when forums such as SMF and phpBB have custom styles and are open source?

Link to comment
Share on other sites

Look i already done this for a company that wanted a blog system spread over 20 over websites

but with one script controlling all 20 blogs, the prince able is the same.

 

A pain but the same exact idear, except this will be multiple forums.

 

You dont get any credit using a all ready designed forum, or using anybody's scripts.

 

Self taut programmers like my self, love a good challenge, and taking someone else's work

is not a challenge.

 

I am a programmer for the reason i like to create my own work, Not use other users work.

 

I no it takes time, but i make sure what i do is all mine, not own buy another.

 

Link to comment
Share on other sites

Self taut programmers like my self, love a good challenge, and taking someone else's work

is not a challenge.

 

I am a programmer for the reason i like to create my own work, Not use other users work.

 

I no it takes time, but i make sure what i do is all mine, not own buy another.

 

I was talking about the company, not you.  Why would they choose you over a proven open source forum? (not trying to be rude just curious)

Link to comment
Share on other sites

How you get your jobs is int a case off what script to use it about being well advertised,

 

Most boss don't even no what php or html is.

 

As long as it works and they like the design there happy.

 

I have never had no one, say to me DONT wont that it not what ever.

 

 

 

 

 

Link to comment
Share on other sites

How you get your jobs is int a case off what script to use it about being well advertised,

 

Most boss don't even no what php or html is.

 

As long as it works and they like the design there happy.

 

I see your point.  Thanks for explaining.

 

I have never had no one, say to me DONT wont that it not what ever.

 

Negation overload, don't understand what this line means.

Link to comment
Share on other sites

I mean because i didnt provide, simplemachines, phpBB, vanilla as there forum i have

never been told why not.

 

Majority off business don't want pre made scripts, Even if there stated as the best scripts in the world,

they want there own and fill they own every dam typed code.

 

 

Link to comment
Share on other sites

 

Look i already done this for a company that wanted a blog system spread over 20 over websites

but with one script controlling all 20 blogs, the prince able is the same.

 

This could have been done in 2 hours with Drupal, and you would get paid the same :)

 

 

You might get paid the same but can you say you designed it from scratch. no

 

so when your head hunted for large projects, and you go for a interview you grab the mouse and download

drupel...

 

how long would it be before the company says good bye.

 

example only, like i say designing everythink from scratch does help.

 

i want reconnection not copy and past exspert

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.