php-crud-api: Can't delete multiple values. Only single

I have a list of answers which I want to delete. Here you can try any id which are presented below http://school528.spb.ru/api/index.php/answers/644,645,646,647,648,649,650,665,651,652,653,654,655,656,657,658,659,660,661,662,663,664,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,695,683,684,685,686,687,688,689,690,691,692,693,702,694,696,697,703,698,699

If I call: http://school528.spb.ru/api/index.php/answers/645 It works If I call: http://school528.spb.ru/api/index.php/answers/645,656 it returns 500 Error.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (14 by maintainers)

Most upvoted comments

Yes it works! Thank you very much!

Thank you for reporting this bug and helping me to find the cause.

SHOW CREATE TABLE answers;

`CREATE TABLE `answers` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `value` varchar(100) CHARACTER SET utf8 NOT NULL,
 `questionId` int(10) NOT NULL DEFAULT '0',
 PRIMARY KEY (`id`),
 KEY `fk_question_id` (`questionId`),
 CONSTRAINT `fk_question_id` FOREIGN KEY (`questionId`) REFERENCES `questions` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=704 DEFAULT CHARSET=latin1`

SELECT VERSION();

5.6.33-79.0-log