Answer the question
In order to leave comments, you need to log in
How to implement the deletion of correspondence in the chat?
Hello. I wrote a small chat for my project. With the ability to create conferences. This is what the DB looks like:
CREATE TABLE `prefix_chat_room` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`admin_id` int(11) NOT NULL ,
`type` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `prefix_chat_message` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`room_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`answer_to` int(11) NOT NULL DEFAULT '0',
`message` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `prefix_chat_room_relation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`room_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`message_id` int(11) NOT NULL DEFAULT '0'
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Answer the question
In order to leave comments, you need to log in
Make 2 flags who has already deleted and who has not on prefix_chat_message
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question