Hi, I want my users to be able to fill out a form and then view the results. That's Ok. I can do that. What I want is that they are able to add a 'message' then add another one. I want this stored with a date so that it can be seen later. So the user can see, the most recent message (the one they just filled out) and the one they entered, say a few days ago. What is the best way of doing this? I was thinking of storing the message and then adding on a certain character, say one that isn't used a lot. Then I'd split it based on where that character appears in the MySQL table. Is this a good idea or can you suggest an easier one? Thanks a million, Ciaran
You'd have to create a new table wouldn't you? A table just for the messages. Also how would I store the replies? Separate columns?
Personally I would store the messages in a table called messages. Have columns : id, title, message, posted, userid, parent The parent column would be how I would know that this message was a reply or a message on it's own. So in that column you would store the id of the message being replied to and in your PHP you would look for any messages with parent id value being the same as the message id. Make sense?
Why not add a simple timestamp column to your messages table and then - ORDER BY timestamp_col DESC LIMIT 2 This will get you the latest messages I am not completely sure why, but this approach is never recommended.