10-26-2008, 12:56 AM
|
#2 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
It may not be the best way, but this should work:
When a student enters, create a row in the database containing a primary key, the ID of the client and helper, along with a (somewhat long, maybe ten char) alpha-numeric ID tag. This alpha-numeric tag is what you use via get to make sure that no one can jump in a chat session. When the conversation is over, delete the row. For internal purposes, use the PK from the temp row. This is because it is faster to search via a PK than a varchar.
So your DB structure would be something like:
Table chats
int(9) id Primary Key Auto Incrementing
int(1) from
text message
Table sessions
int(9) id Primary Key Auto Incrementing
int(9) agentId
int(9) chatsId
varchar(10) external_key
You then find the sessions row with the external key matching the GET data. From there, use the chatsId to pull the records you need.
|
|
|
|