Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / MySQL help

Author
Message
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 6th Sep 2004 02:13
i was pondering last night about tables

one for users (granted)
one for forum details (as in the forum and descriptions)
what about threads?

i thought this:
the creation of a thread makes a new table
the name is the thread id and the forum no its meant to be in (eg. 00001.1) the title etc is contained within the table

if can think of nothing that would stop this from working but i have a feeling its not correct (a deep down one in fact )

can anyone enlighten me on this subject?

thanks
N30F15H

PS. i dont like the fact that the thing restricts the title to 6 characters min, i wanted to put MySQL

Yes i know im a bastage but who cares?
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 6th Sep 2004 03:14
Why not have
A table for forums
A table for threads
A table for posts

When you view the forum it shows all the items in the forums table.
When you view a forum it shows all the threads that belong to that forum.
When you view a thread it shows all the posts that belong to that thread.

At least thats how I would do it, not that I have ever written a forum or even have much database experiance.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 6th Sep 2004 03:18 Edited at: 6th Sep 2004 03:20
How I did it was:

boards table - all the boards

topics table - all topics, with the ID of their parent board

users table - all the users

posts table - all the posts with the ID of their parent topic and parent user

and to get the posts, who posted them and all teh usual paraphanalia (avatars etc)



Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 6th Sep 2004 03:38
hmm ok, now to learn SQl (i understand the query thing so im not that sunk )

btw if u were interested (HA!) im having a really simple forum with say 2/3 boards, no user profile things (as in interests)

Yes i know im a bastage but who cares?
zane
20
Years of Service
User Offline
Joined: 23rd Feb 2004
Location: manchester, england
Posted: 6th Sep 2004 03:49
im currently building a forum that works like that (N30F15H 's way). i think it takes up alot more space though (i need to get round to redoing it).

www.zaneinteractive.uni.cc - my brand new site, check it out - NOW!!!!!
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 6th Sep 2004 03:55 Edited at: 6th Sep 2004 03:55
once ive got the simple forum done and working i'll make it customisalbe and redo teh tables with things like avatars

EDIT: @rich which method (if any) did you use?

thanks

Yes i know im a bastage but who cares?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 6th Sep 2004 04:02 Edited at: 6th Sep 2004 04:03
My forums that I built form scratch (If you want ideas)

http://www.davidtattersall.me.uk/pb2

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 6th Sep 2004 04:04 Edited at: 6th Sep 2004 04:46
ok this is getting annoying:

i need to make this table:

ID (5 char int)
Username (15 char max text)
Password (32 char text)
Email (30 char text)
Rank (1 char max)

An example if that didnt make sense is this:
ID, Username, Password, Email, Rank
00001, N30F15H, 32 char md5 hash, neofish@gmail.com, 2

this is really annoying me because when i use phpMyAdmin to make a table like that it returns this error:


can anyone help me before i trawl through the documentation

thanks

edit: @David T id already seen urs thanks

Yes i know im a bastage but who cares?
Zero Blitzt
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location: Different Stages
Posted: 6th Sep 2004 04:44
I dont think TEXT has any character limits (you have TEXT(32) and TEXT(50), I think it should just be TEXT, although for a username, password, email, and basically everything except a message, you should use tinytext or mediumtext)


Come to #coding. We promise we wont kick you!
DISCLAIMER: Promises may not actually be upheld.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 6th Sep 2004 05:20
Just make the table with an SQL query?

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 6th Sep 2004 05:32
i was trying but it didnt work, however, i looked at some help files and found out that the server program got the syntax wrong and now it works

btw david t, u use 1 page dont you and use $_GET?

Yes i know im a bastage but who cares?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 6th Sep 2004 06:10
I have this:





Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 6th Sep 2004 06:17
ah makes sense, i mite do that

btw http://pulse.dbspot.com/forums/index.php?a=users

shows the user table without the pass

Yes i know im a bastage but who cares?
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 6th Sep 2004 08:36
wooo Update:

you can view all posts and threads etc but you cant post or register or login lol

for a thing that took me 3 hours and 20 minutes to code and iron bugs out, what do u think?

thanks for all your help again

Yes i know im a bastage but who cares?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 6th Sep 2004 20:22
Logging in is easy peasy. All you do is create a session and store the urrent user's ID. Then, in an include file put something like this:



And then in the rest of the document if you want to say "Hi, username!" just put this:



And to log somebody in, just set up a session variable called $userid with their ID in.

Another thing I like alot is the "who's online" bit. That is also very easy. Put this at the beginning of the script:



And then to display the users online just join the activeusers table with the users table and show results

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 7th Sep 2004 07:55 Edited at: 7th Sep 2004 07:56
wooo, i had a forum reform, you cant view the messages but everything else that the other one had works, better

special thanks to David T who helped a lot so i may be able to progress without guidance

:: In Progress: Pulse Board Forums ::

Login to post a reply

Server time is: 2024-11-26 00:47:23
Your offset time is: 2024-11-26 00:47:23