I have a small table in MySQL that is used to control sort order of items on a web page.
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` text NOT NULL,
`live` text NOT NULL,
`order` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
As above, the order column should not be unique, but in phpMySQLadmin it shows as unique and when even thought I have deleted rows and there are only 5 entries when I search using either of the following, it returns a value like '23' which seems to be an auto-increment value:
SELECT * FROM menus_types ORDER BY `order` DESC LIMIT 1
or
SELECT MAX( `order` ) FROM menus_types
I have tried using SQL to get index names, using SHOW INDEX FROM menus_types
but only the indexes on id
column are returned.
If I try ALTER TABLE menus_types DROP INDEX 'unique'
or ALTER TABLE menus_types DROP INDEX order
as detailed here "sql DROP CONSTRAINT UNIQUE not working" then I get a syntax warning.
Any suggestions as I need to be able to add remove and edit the order
column with predictable results?
EDIT AS REQUESTED
CREATE TABLE `menus_types`
( `id` int(11) NOT NULL AUTO_INCREMENT,
`type` text NOT NULL,
`live` text NOT NULL,
`order` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`))
ENGINE=MyISAM
AUTO_INCREMENT=9
DEFAULT CHARSET=latin1