I am using PHPMyAdmin 4.6.0 (current stable) on my Mac to manage the MySQL tables. I have created a table with the following schema:
CREATE TABLE `table1` (
`id` int(11) NOT NULL,
`name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`table2id` int(11) NOT NULL,
`col2` float DEFAULT NULL,
`col3` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `table1`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_table1_table2` (`table2id`);
ALTER TABLE `table1`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
When viewing the data from table1, I select some of the rows using the checkboxes on the left hand side and then press delete link below the table. I am redirected to another page, showing the following SQL queries to be executed:
DELETE FROM `table1` WHERE ;
DELETE FROM `table1` WHERE ;
DELETE FROM `table1` WHERE ;
Note that the ID of the dataset is missing here, resulting in the queries to fail. Something similar happens if I press the "delete" button within a row. A modal appears, showing the following output:
Do you really want to execute "DELETE FROM `table1` WHERE LIMIT 1"?
Note that the WHERE
clause is missing here, too. It however works with different tables in another database or even another table within the same database. For example, another table has the following schema:
CREATE TABLE `table3` (
`id` int(11) NOT NULL,
`name` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`shortname` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `table3`
ADD PRIMARY KEY (`id`);
ALTER TABLE `table3`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
Actually I can't see any difference here that would cause this behaviour of PHPMyAdmin. Any idea?