redarrow Posted December 23, 2008 Share Posted December 23, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/ Share on other sites More sharing options...
flyhoney Posted December 23, 2008 Share Posted December 23, 2008 Honestly, no. You have duplicated columns like forum_name and topic_name. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722561 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 Surely you've heard of normalization. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722575 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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, Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722594 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722600 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 varchar(3) problams Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722604 Share on other sites More sharing options...
flyhoney Posted December 23, 2008 Share Posted December 23, 2008 redarrow you are crytpic. I don't know what you're up to, but it scares me. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722610 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722613 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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 ); Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722619 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 I scare u because you dont read the correct books or web sites it all works. I was referring to w3schools and tizag... I hope they're correct, I use them everyday! Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722623 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 Ill print it now to see if my written off the head database will allow me to build a multi complex forum. i bet it does what the odds lol. THERE GOOD WEBSITES BUT I STUDY HARD AND USE REFERENCES VIA GURU'S LOL. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722627 Share on other sites More sharing options...
flyhoney Posted December 23, 2008 Share Posted December 23, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722630 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 look i done the database of my head didn't even rely look, i will print it and get back the database is for multiple forums not one wait and see ill correct it. only was a 5 min out burst lol Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722635 Share on other sites More sharing options...
flyhoney Posted December 23, 2008 Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722639 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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... Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722641 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722644 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722666 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722670 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722677 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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) Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722681 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722688 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722693 Share on other sites More sharing options...
flyhoney Posted December 23, 2008 Share Posted December 23, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722694 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722697 Share on other sites More sharing options...
redarrow Posted December 23, 2008 Author Share Posted December 23, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/138209-solved-does-my-database-structure-look-correct-for-a-forum/#findComment-722701 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.