Storing a message
Posted: Sat Jul 19, 2008 2:36 pm
I'm not sure whether this question should go here or in the database section; it seems relevant to both.
I've been all over the internet, but can't find an answer to this question. I like to play an online game with other members of my clan. Our clan has recently decided that we want to open up our own league for any player to join. I'm the main coder in our clan for this site. I can do sessions, cookies, and whatnot, but I'm stumped on this one aspect:
My plan is to create a pseudo-forum, similar to phpbb and other forum layouts, but without many of the bells and whistles; only specific aspects that we're actually going to use. I know how to use PHP, I know how to use MySQL, and I know how to use both of them together. Therefore, communicating with a database is not a problem. However, I don't know how to go about making a method to save messages that users post so that they can be retrieved later. I've looked at how phpbb works, and have found that it seems to keep a record for each forum entry. However, the messages are always encoded to an MD5, which is not reversable. I mean, the forum has to keep the messages /somewhere/ while only using the MD5 to validate them before posting them on the forum pages.
What I /can/ do, is save each message posted as a super long entry in a database table, but that seems horribly inefficent, and since forums don't seem to use this tactic, there's got to be a better way. I mean, I can encode them using MD5, but then there's no way to de-code them for displaying them back on the forum. Gahh! Is there a better way of doing what I'm trying to do, without storing an entire message in one table cell in the database?
Obviously, I'm not asking for specific code, only an idea of how to save long messages without taking up a lot of space. Any ideas or suggestions are truly appreciated.
I've been all over the internet, but can't find an answer to this question. I like to play an online game with other members of my clan. Our clan has recently decided that we want to open up our own league for any player to join. I'm the main coder in our clan for this site. I can do sessions, cookies, and whatnot, but I'm stumped on this one aspect:
My plan is to create a pseudo-forum, similar to phpbb and other forum layouts, but without many of the bells and whistles; only specific aspects that we're actually going to use. I know how to use PHP, I know how to use MySQL, and I know how to use both of them together. Therefore, communicating with a database is not a problem. However, I don't know how to go about making a method to save messages that users post so that they can be retrieved later. I've looked at how phpbb works, and have found that it seems to keep a record for each forum entry. However, the messages are always encoded to an MD5, which is not reversable. I mean, the forum has to keep the messages /somewhere/ while only using the MD5 to validate them before posting them on the forum pages.
What I /can/ do, is save each message posted as a super long entry in a database table, but that seems horribly inefficent, and since forums don't seem to use this tactic, there's got to be a better way. I mean, I can encode them using MD5, but then there's no way to de-code them for displaying them back on the forum. Gahh! Is there a better way of doing what I'm trying to do, without storing an entire message in one table cell in the database?
Obviously, I'm not asking for specific code, only an idea of how to save long messages without taking up a lot of space. Any ideas or suggestions are truly appreciated.