全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1370|回复: 1

大神,来看看

[复制链接]
发表于 2017-6-20 09:04:05 | 显示全部楼层 |阅读模式
大神们,帮帮忙,为啥这里执行错误
CREATE TABLE film(
    id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    infohash CHAR(40) UNIQUE,
    name VARCHAR(300) DEFAULT "",
    length BIGINT UNSIGNED DEFAULT 0,
    ctime INT UNSIGNED DEFAULT 0,
    click INT UNSIGNED DEFAULT 0,
    lastac INT UNSIGNED NOT NULL,
    ymd DATE NOT NULL
)ENGINE=MyISAM CHARACTER SET "utf8";

CREATE TABLE IF NOT EXISTS file(
    id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    fmid INT UNSIGNED NOT NULL,
    file VARCHAR(300) NOT NULL DEFAULT "",
    length BIGINT UNSIGNED DEFAULT 0
)ENGINE=MyISAM CHARACTER SET "utf8";
CREATE INDEX fmid_i ON file(fmid);

CREATE TABLE IF NOT EXISTS sph_counter(
    counter_id INT PRIMARY KEY NOT NULL,
    max_doc_id INT NOT NULL
)ENGINE=MyISAM CHARACTER SET "utf8";

CREATE TABLE IF NOT EXISTS counter(
    ymd DATE PRIMARY KEY,
    today INT UNSIGNED
)ENGINE=MyISAM CHARACTER SET "utf8";

DELIMITER |
CREATE TRIGGER after_film_insert AFTER INSERT ON film
FOR EACH ROW BEGIN
    INSERT INTO counter(ymd, today) VALUES(new.ymd, 1)
    ON DUPLICATE KEY UPDATE today=today+1;
END
|
DELIMITER ;
发表于 2017-6-24 14:57:41 | 显示全部楼层
没有问题,有问题的话是和别的语句结合才会有!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-1-18 16:05 , Processed in 0.060174 second(s), 7 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表