我在与App Inventor中的应用程序连接的FusionTables中有下表:
每当有人写一个参与者的名称并从应用程序发送时,我需要在我的数据库中添加1个投票。
一切正常,但我无法实现这一目标。 我的错误代码是:
CREATE TABLE `category` (
`category_id` int(11) NOT NULL,
`parent_id` int(11) NOT NULL DEFAULT '0'
)
CREATE TABLE `category_description` (
`cd_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`language_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL
)
CREATE TABLE `language` (
`language_id` int(11) NOT NULL,
`name` varchar(32) NOT NULL,
`code` varchar(5) NOT NULL,
`locale` varchar(255) NOT NULL,
`image` varchar(64) NOT NULL,
`directory` varchar(32) NOT NULL,
`sort_order` int(3) NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL
)
CREATE TABLE `product` (
`product_id` int(11) NOT NULL,
`model` varchar(64) NOT NULL,
`price` decimal(15,4) NOT NULL DEFAULT '0.0000'
)
CREATE TABLE `product_description` (
`product_id` int(11) NOT NULL,
`language_id` int(11) NOT NULL
)
CREATE TABLE `product_to_category` (
`product_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL
)
ALTER TABLE `category`
ADD PRIMARY KEY (`category_id`,`parent_id`),
ADD KEY `parent_id` (`parent_id`);
ALTER TABLE `category_description`
ADD PRIMARY KEY (`cd_id`,`category_id`,`language_id`),
ADD KEY `name` (`name`);
ALTER TABLE `language`
ADD PRIMARY KEY (`language_id`),
ADD KEY `name` (`name`);
ALTER TABLE `product`
ADD PRIMARY KEY (`product_id`);
ALTER TABLE `product_description`
ADD PRIMARY KEY (`product_id`,`language_id`),
ADD KEY `name` (`name`);
ALTER TABLE `product_to_category`
ADD PRIMARY KEY (`product_id`,`category_id`),
ADD KEY `category_id` (`category_id`);
ALTER TABLE `category`
MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=202;
ALTER TABLE `category_description`
MODIFY `cd_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=961;
ALTER TABLE `language`
MODIFY `language_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
ALTER TABLE `product`
MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=85;