I am creating a ticket system for issues regarding IT. I have the following table:
id
userID
priority
details
rank
conversation
order
status
ts
What I need is to be able to display the back and forth between the IT dept and the user as a conversation. So i figure I have the two columns conversation and order. The column conversation would be a unique identifier (number or text) and the order would show the order that the row plays in the converstation (1,2,3 etc).
My question is this:
- Is this the best way to go about it?
- how shall I identify each conversation?
I could either generate random PHP 5 char text or something, or give a number, and each user has conversation number 1, number 2 etc. But then If I did that, how would I find out the next number to use for the user using mySQL?
Any thoughts and suggestions would be helpful, thank you.
I’d go for a separate table like @Debock mentioned. I’d structure it a bit differently though:
The timestamp allows you to keep track of when the comment was made, and ordering by it will give you the sequence of comments.