我为我的网站创建了一个备份和还原功能,并且我使用codeigniter作为框架。当我使用框架的dbutil时,备份文件未引用插入值,这会由于语法错误而在将sql文件导入到数据库中时导致错误。
INSERT INTO `account_client`
(`IdClient`, `FirstName`, `LastName`, `Contact`, `Email`,
`Username`, `Password`, `Profile`, `DateMod`, `Status`,
`suspend_from`, `suspend_to`, `suspend_day`)
VALUES (8, Remuel, Sigua, 03222212121, remuelsigua@gmail.com,
Rem21, $2y$10$hPb/gA6Pyy/6IWO87gJfi.4UIh8pB/GZdBVHxFHahI/fcfwrYUkx6,
NULL, 2018-11-17 17:01:06, 1, NULL, NULL, NULL);
答案 0 :(得分:0)
请将您的字符串值放在”之内,如下所示
INSERT INTO `account_client`
(`IdClient`, `FirstName`, `LastName`, `Contact`, `Email`,
`Username`, `Password`, `Profile`, `DateMod`, `Status`,
`suspend_from`, `suspend_to`, `suspend_day`)
VALUES (8, 'Remuel', 'Sigua', 03222212121, 'remuelsigua@gmail.com',
'Rem21, '$2y$10$hPb/gA6Pyy/6IWO87gJfi.4UIh8pB/GZdBVHxFHahI/fcfwrYUkx6',
NULL, '2018-11-17 17:01:06', 1, NULL, NULL, NULL);