Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Name Space Provider

ggxggx Member Posts: 4
Hello,

I'm not sure if this is the right place to ask my question, but I think you guys can help...

Can anybody tell me about a good way to save forum data in a MySQL database? I'm thinking about a table with four columns: user, time, reply, and msg. reply is an integer. If it's 0 then it means it's the main message, otherwise it's a reply. For example, if reply is set to '1' then it's a reply to the main message, and if it's set to '2' then it's a reply to level '1' messages, ...etc.
Although that seems to be OK, but I will then have problems with inserting data into the database since I'll need to insert specific data between two specific rows for example.

I'd really appreciate it if somebody can help me with this or tell me some other format to save data with.

Thanks in advance.

Comments

  • jcarlssonjcarlsson Member Posts: 21
    : Can anybody tell me about a good way to save forum data in a MySQL database? I'm thinking about a table with four columns: user, time, reply, and msg. reply is an integer. If it's 0 then it means it's the main message, otherwise it's a reply. For example, if reply is set to '1' then it's a reply to the main message, and if it's set to '2' then it's a reply to level '1' messages, ...etc.
    : Although that seems to be OK, but I will then have problems with inserting data into the database since I'll need to insert specific data between two specific rows for example.

    I wouldn't do it like that. I would do it like this:
    *message id (UNIQUE auto_increment that starts on 1 and counts up)
    *poster (the user that posted it)
    *date (the date it was posted)
    *reply (the id for the message it is a reply to or 0 if it isn't a reply)
    *the message

    I think that this way should open up the possibilities to have many replies on the same level to the same message and I don't understand how you should show what message it is a reply to in your model. When I'm going to make a forum (which I am going to do soon I think) I'll follow my model (I made it for my forum) :-)
    [red]--[/red]
    [green]jcarlsson[/green] [blue]<[/blue][purple]jcarlsson@linux.nu[/purple][blue]>[/blue]
    [red]http://www.jcarlsson.tk[/red]

  • Andre YoungAndre Young USAMember Posts: 0

    _ < http://forcoder.org /> free ebooks and video tutorials about || R Visual Basic .NET C Swift C++ JavaScript PHP Go Python Objective-C Visual Basic PL/SQL Scratch Delphi Ruby Assembly MATLAB Perl C# Java Kotlin Lua VBScript Prolog Scala COBOL Apex Hack Dart FoxPro ML SAS Clojure Alice Awk Rust Ada Scheme F# Fortran Bash Crystal Transact-SQL Julia D Erlang Lisp Logo LabVIEW ABAP || _____________

Sign In or Register to comment.