I need PHP help!
Page 1 of 1
Serben
Banned



Posts: 1428
Location: Sweden
PostPosted: Fri, 26th May 2006 13:50    Post subject: I need PHP help!
Ok, i'm working on a PHP project for school. I'm making a basic forum. I've already made a guestbook before so i already know the basics of making registration and log in/log out code, as well as the actual guestbook where you post messages. But now that i'm making a forum it's much harder. I need to know how to create threads and how to make the message that the user types appear inside the thread as the first message. I also need to know how to implement admin tools, like the ability to edit and delete messages. I already know the basics of deleting stuff. I just can't figure out how to let the code know the ID number of that particular message so it knows exactly which one to delete, if you know what i mean. Anyway, here are what my MySQL tables look like:


table name: user
id int not null auto_increment (primary key)
name varchar(20)
pass varchar(32)
class int (for determining admin/normal user rights)

table name: thread
id int not null auto_increment (prim. key)
user_id (foreign key; reference id from the user table)
subject varchar(20)

table name: message
id int not null auto_increment (prim. key)
date timestamp
user_id (for. key; reference id from the user table)
thread_id (for. key; reference id from the thread table)
subject varchar(20)
body varchar(1000)



That's what my tables look like. Now could someone help me out here?
Back to top
blizzerdz




Posts: 2

PostPosted: Sat, 17th Jun 2006 21:01    Post subject:
here is some ideas, try phpBB2 can be located at http://phpbb.com or you can try smf simple machines forum. do a google search, its install forums, so you only need to download then to the youre comp, extract the files into youre ftp server aka homepage and start the instalation.

not to hard, just remember youre sql--hehe

Regards
Back to top
[mrt]
[Admin] Code Monkey



Posts: 1338

PostPosted: Sun, 18th Jun 2006 20:30    Post subject:
Well a logical approach would be to add a first_post_id column to the thread table so you know where to start. Then you have to somehow bind the other replys to the thread aswell. You can do that by, for example adding a thread_id to the messages table, pull them out via the thread id and sorting them by their id/posted time.

And thats how the ball keeps rolling...


teey
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group