Page 1 of 1

Create error for duplicate comment titles

Posted: Sat Mar 28, 2009 7:11 pm
by ninethousandfeet
hello,

i allow users to start comment conversations with one another. when a new conversation is started, the user is required to enter a topic title.
example:
-- Topic: Hello, Nice to meet you! ... Joe, John, and Carol are all in this ongoing chat/conversation.
-- Billy decides to start a new conversation with Bobby and names the Topic: Hello, Nice to meet you!
-- Now Billy and Bobby show up in the dialogue with Joe, John, and Carol rather than just a chat between themselves.

I can't make my comment_title field unique because I use it to relate every comment that is posted in the ongoing conversations.
Does anyone know how I can simply set up a conditional IF statement to check just the insert NEW comment form so that $_POST['comment_title'] does not equal a comment_title in use?

thank you!

Re: Create error for duplicate comment titles

Posted: Sat Mar 28, 2009 10:13 pm
by tech603
If your going to allow duplicate names to be created in your database you need another way to identify your chat conversations. The chat should not be identified by its name but rather a unique id field. Given the assumption that your conversations or how they are viewed rather are based on there names, i would say that unique identifiers not for the name but for the topic itself would fix your problem

Hope that helps.

Re: Create error for duplicate comment titles

Posted: Sat Mar 28, 2009 10:27 pm
by ninethousandfeet
i will try that out and see how it works out, i think i get what you are saying. thank you!