CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(100) NOT NULL,
`password` varchar(35) NOT NULL,
`groupid` int(11) NOT NULL,
`groupname` varchar(100) NOT NULL,
`phone` varchar(35),
`introduction` varchar(255),
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
CONSTRAINT FOREIGN KEY ('groupid', 'groupname')
REFERENCES group ('id', 'groupname')
ON DELETE RESTRICT
ON UPDATE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''groupid', 'groupname')
REFERENCES group ('id', 'groupname')
ON DELETE RESTRICT
`id` int(11) NOT NULL auto_increment,
`username` varchar(100) NOT NULL,
`password` varchar(35) NOT NULL,
`groupid` int(11) NOT NULL,
`groupname` varchar(100) NOT NULL,
`phone` varchar(35),
`introduction` varchar(255),
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
CONSTRAINT FOREIGN KEY ('groupid', 'groupname')
REFERENCES group ('id', 'groupname')
ON DELETE RESTRICT
ON UPDATE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''groupid', 'groupname')
REFERENCES group ('id', 'groupname')
ON DELETE RESTRICT
