Mysql我在插入数据后尝试编辑时收到错误

时间:2016-11-08 19:01:35

标签: mysql phpmyadmin

这是我的数据库表结构之一,在插入一些字段作为行后,我无法更新列,我得到错误:

CREATE TABLE `channels` (
  `id` int(11) NOT NULL,
  `channelName` varchar(30) COLLATE utf8_persian_ci NOT NULL,
  `channelLink` varchar(50) COLLATE utf8_persian_ci NOT NULL,
  `channelDescription` varchar(100) COLLATE utf8_persian_ci NOT NULL,
  `channelImageFileName` varchar(100) COLLATE utf8_persian_ci NOT NULL,
  `channelAvatarFileName` varchar(100) COLLATE utf8_persian_ci NOT NULL,
  `channelState` tinyint(1) NOT NULL,
  `channelType` enum('channels','userCreatedChannels') COLLATE utf8_persian_ci NOT NULL,
  `channelOwnerUserId` int(11) NOT NULL,
  `fileServerUrlId` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `channels`
--
ALTER TABLE `channels`
  ADD PRIMARY KEY (`id`);

错误并注意:

This table does not contain a unique column. Features related to the grid edit, checkbox, Edit, Copy and Delete links may not work after saving.

错误

UPDATE `channels` SET `channelState` = '1' WHERE  LIMIT 1

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 1' at line 1
此表的

id是唯一且A_I,我该如何解决此问题?

0 个答案:

没有答案