在使用 PHP 和 MySQL 构建的私有(private)消息系统中,用户可以撰写新消息并回复消息。有两个按钮:“发送”和“保存”。消息状态存储在数据库中(0=尚未发送,1=已发送)。此外,该消息会自动保存,例如通过 ajax 调用需要 3 分钟。
发送的消息和草稿都存储在数据库的同一个表中。现在,您什么时候执行INSERT INTO messages ...
?
如果用户点击撰写新消息或回复?如果用户没有发送消息、关闭窗口、按下后退按钮,如何清除所有从未发送过的消息?
您建议还有哪些其他选择?
最佳答案
Aren't the automatically saved messages visible as a draft version? Then they will clean up most of them by themselves
按照要求回答;)
关于php - 消息系统: Save and Send - when to do the INSERT of a new message?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11500940/