删除#还是第一行数据允许我将其输入数据库?

bpsygsoo  于 2021-06-18  发布在  Mysql
关注(0)|答案(0)|浏览(167)

所以,我建立了一个新的数据库和一个表,没什么特别的,只是一个快速的、草率的mysql数据库,现在已经足够好了:

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

CREATE TABLE `cards` (
  `ID` int(11) NOT NULL,
  `Name` varchar(32) NOT NULL,
  `setNumber` int(3) NOT NULL,
  `setYear` varchar(10) NOT NULL,
  `setName` varchar(64) NOT NULL,
  `setCode` varchar(10) NOT NULL,
  `owned` int(1) NOT NULL,
  `goal` int(1) NOT NULL,
  `rarity` varchar(16) DEFAULT NULL,
  `atribute` varchar(8) NOT NULL,
  `level` int(2) DEFAULT NULL,
  `race` varchar(16) DEFAULT NULL,
  `special` varchar(8) DEFAULT NULL,
  `type` varchar(8) DEFAULT NULL,
  `atk` int(4) DEFAULT NULL,
  `def` int(4) DEFAULT NULL,
  `text` text NOT NULL,
  `link` varchar(128) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

ALTER TABLE `cards`
  ADD PRIMARY KEY (`ID`);

ALTER TABLE `cards`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

有趣的是:
我尝试用一些数据填充表格:

INSERT INTO `cards` (`ID`, `Name`, `setNumber`, `setYear`, `setName`, `setCode`, `owned`, `goal`, `rarity`, `atribute`, `level`, `race`, `special`, `type`, `atk`, `def`, `text`, `link`) VALUES 
(NULL, 'Skull Servant','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','DARK','1','Zombie','','Normal','300','200','A skeletal ghost that isn\'t strong but can mean trouble in large numbers.','foff?ope=2&cid=4030'),
(NULL, 'Dark Magician','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','Ultra Rare','DARK','7','Spellcaster','','Normal','2500','2100','The ultimate wizard in terms of attack and defense.','foff?ope=2&cid=4041'),
(NULL, 'Gaia The Fierce Knight','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','Ultra Rare','EARTH','7','Warrior','','Normal','2300','2100','A knight whose horse travels faster than the wind. His battle-charge is a force to be reckoned with.','foff?ope=2&cid=4044'),
(NULL, 'Celtic Guardian','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','Super Rare','EARTH','4','Warrior','','Normal','1400','1200','An elf who learned to wield a sword, he baffles enemies with lightning-swift attacks.','foff?ope=2&cid=4047'),
(NULL, 'Basic Insect','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','EARTH','2','Insect','','Normal','500','700','Usually found traveling in swarms, this creature\'s ideal environment is the forest.','foff?ope=2&cid=4056'),
(NULL, 'Mammoth Graveyard','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','EARTH','3','Dinosaur','','Normal','1200','800','A mammoth that protects the graves of its pack and is absolutely merciless when facing grave-robbers.','foff?ope=2&cid=4065'),
(NULL, 'Silver Fang','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','EARTH','3','Beast','','Normal','1200','800','A snow wolf that\'s beautiful to the eye, but absolutely vicious in battle.','foff?ope=2&cid=4071'),
(NULL, 'Dark Gray','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','EARTH','3','Beast','','Normal','800','900','Entirely gray, this beast has rarely been seen by mortal eyes.','foff?ope=2&cid=4119'),
(NULL, 'Trial of Nightmare','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','DARK','4','Fiend','','Normal','1300','900','This fiend passes judgment on enemies that are locked in coffins.','foff?ope=2&cid=4125'),
(NULL, 'Nemuriko','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','DARK','3','Spellcaster','','Normal','800','700','A child-like creature that controls a sleep fiend to beckon enemies into eternal slumber.','foff?ope=2&cid=4135'),
(NULL, 'The 13th Grave','1','03/08/2002','LEGEND OF BLUE EYES WHITE DRAGON','','0','3','','DARK','3','Zombie','','Normal','1200','900','A zombie that suddenly appeared from plot #13 - an empty grave.','foff?ope=2&cid=4138');

它把这个扔到我的脸上:
1064-您的sql语法有错误;查看与mysql服务器版本相对应的手册,以获得在第12行“突然从绘图中出现的僵尸”附近使用的正确语法
所以我想“哦,好吧,我会在几秒钟内解决的”-但没有什么突出。所以我检查了错误信息,想“好吧,那不可能,是吗?”但果然,这个符号导致了一个错误。我觉得…很奇怪。
不管怎样,我分心了,然后回到电脑前,试着从我离开的地方开始,所以我复制了我插入的数据,但这次我遗漏了最上面一行,(骷髅仆人),忘了删除#符号…代码成功了!
问题是…删除一段文本中的#符号如何使代码工作-或者保留该#符号并删除第一行?
我一遍又一遍地查看,输入的数据看起来并不奇怪,也没有任何突出的地方,所以这怎么可能呢?
我开始觉得鬼魂应该为这种奇怪的行为负责。请向我解释一下这种奇怪的行为,因为我真的不知道怎样才能解决它。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题