Děkuji vám mnohokrát.
Kromě této chyby, co jste mi napsal pomohlo i přidat strukturu tabulek
INSERT INTO `tabulka` (struktura) VALUES (hodnoty);
Děkuji vám mnohokrát.
Kromě této chyby, co jste mi napsal pomohlo i přidat strukturu tabulek
INSERT INTO `tabulka` (struktura) VALUES (hodnoty);
Dobrý den,
v php generuju kód, pro zálohování databáze, a nějak mi nejde databáze zpět nahrát (vytvořil jsem ho podle zálohy z navicatu) již jsem bezradný :(
/*
Záloha aplikace noName
3.2.2014 15:1
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `firmy`
-- ----------------------------
DROP TABLE IF EXISTS `firmy`;
CREATE TABLE `firmy` (
`id` int(11) NOT NULL auto_increment,
`firma` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `material`
-- ----------------------------
DROP TABLE IF EXISTS `material`;
CREATE TABLE `material` (
`id` int(11) NOT NULL auto_increment,
`firma` text,
`nazev` text,
`cena` text,
`hustota` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `operace
-- ----------------------------
DROP TABLE IF EXISTS `operace`;
CREATE TABLE `operace` (
`id` int(11) NOT NULL auto_increment,
`carovy_kod` text,
`jmeno` int(11) default NULL,
`stroj` text,
`cas` int(11) default NULL,
`pocet` int(11) default NULL,
`datum` text,
`zmetek` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `podnik`
-- ----------------------------
DROP TABLE IF EXISTS `podnik`;
CREATE TABLE `podnik` (
`id` int(11) NOT NULL auto_increment,
`podnik` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `polotovar`
-- ----------------------------
DROP TABLE IF EXISTS `polotovar`;
CREATE TABLE `polotovar` (
`id` int(11) NOT NULL auto_increment,
`pro` int(11) default NULL,
`material` text,
`firma` int(11) default NULL,
`polotovar` text,
`povrchova_uprava` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sazba`
-- ----------------------------
DROP TABLE IF EXISTS `sazba`;
CREATE TABLE `sazba` (
`id` int(11) NOT NULL auto_increment,
`stroj` text,
`sazba` int(11) default NULL,
`pocet_kusu` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `vykresy`
-- ----------------------------
DROP TABLE IF EXISTS `vykresy`;
CREATE TABLE `vykresy` (
`id` int(11) unsigned NOT NULL auto_increment,
`cislo` text,
`zakazka` text,
`barcode` text,
`pocet_kusu` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `tepelne_zpracovani`
-- ----------------------------
DROP TABLE IF EXISTS `tepelne_zpracovani`;
CREATE TABLE `tepelne_zpracovani` (
`id` int(11) NOT NULL auto_increment,
`zpracovani` text,
`cena` int(11) default NULL,
`allow` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `zakazky`
-- ----------------------------
DROP TABLE IF EXISTS `zakazky`;
CREATE TABLE `zakazky` (
`id` int(11) NOT NULL auto_increment,
`zakazka` text,
`firma` int(11) default NULL,
`podnik` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `zamestnanci`
-- ----------------------------
DROP TABLE IF EXISTS `zamestnanci`;
CREATE TABLE `zamestnanci` (
`id` int(11) NOT NULL auto_increment,
`zamestnanec` text,
`zamestnan` int(11) default NULL,
`code` text,
`podnik` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;)
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `firmy` VALUES (1, 'a');
INSERT INTO `material` VALUES (1, '0', 'Dural (AlMgSi0,5; AlMgSi1)', '150', '2.7'), (2, '0', 'DuralQuality (ACP 5080)', '200', '2.7'), (3, '0', 'Ocel (St37; C45; 11SMn30) ', '45', '7.85'), (4, '0', 'Ocel (16MnCr5)', '50', '7.85'), (5, '0', 'Nástrojová ocel(WS1.2510)', '350', '7.85'), (6, '0', 'CuCrZr', '500', '8.89'), (7, '0', 'Měď (ECu57, ECu58, COPPER)', '300', '8.89'), (8, '0', 'Mosaz (MS58, MS63, BRASS, CuZn)', '300', '8.45'), (9, '0', 'Bronz (CuSn)', '400', '8.7'), (10, '0', 'Nerez (RVS317, SS316, SS304)', '150', '7.85');
INSERT INTO `material` VALUES (11, '0', 'Nástrojová ocel (WS1.2379)', '400', '7.85'), (12, '0', 'PE 1000 zelený', '286', '0.93'), (13, '0', 'PE 1000 natural', '300', '1'), (14, '0', 'Textit', '276', '1.45'), (15, '0', '6SA bílý', '266', '1.25'), (16, '0', 'PA6G natural', '251', '1.33'), (17, '1', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (18, '1', 'DuralQuality (ACP 5080)', '0', '2.7'), (19, '1', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (20, '1', 'Ocel (16MnCr5)', '0', '7.85');
INSERT INTO `material` VALUES (21, '1', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (22, '1', 'CuCrZr', '0', '8.89'), (23, '1', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (24, '1', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (25, '1', 'Bronz (CuSn)', '0', '8.7'), (26, '1', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (27, '1', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (28, '1', 'PE 1000 zelený', '0', '0.93'), (29, '1', 'PE 1000 natural', '0', '1'), (30, '1', 'Textit', '0', '1.45');
INSERT INTO `material` VALUES (31, '1', '6SA bílý', '0', '1.25'), (32, '1', 'PA6G natural', '0', '1.33'), (33, '2', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (34, '2', 'DuralQuality (ACP 5080)', '0', '2.7'), (35, '2', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (36, '2', 'Ocel (16MnCr5)', '0', '7.85'), (37, '2', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (38, '2', 'CuCrZr', '0', '8.89'), (39, '2', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (40, '2', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45');
INSERT INTO `material` VALUES (41, '2', 'Bronz (CuSn)', '0', '8.7'), (42, '2', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (43, '2', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (44, '2', 'PE 1000 zelený', '0', '0.93'), (45, '2', 'PE 1000 natural', '0', '1'), (46, '2', 'Textit', '0', '1.45'), (47, '2', '6SA bílý', '0', '1.25'), (48, '2', 'PA6G natural', '0', '1.33'), (49, '3', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (50, '3', 'DuralQuality (ACP 5080)', '0', '2.7');
INSERT INTO `material` VALUES (51, '3', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (52, '3', 'Ocel (16MnCr5)', '0', '7.85'), (53, '3', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (54, '3', 'CuCrZr', '0', '8.89'), (55, '3', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (56, '3', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (57, '3', 'Bronz (CuSn)', '0', '8.7'), (58, '3', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (59, '3', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (60, '3', 'PE 1000 zelený', '0', '0.93');
INSERT INTO `material` VALUES (61, '3', 'PE 1000 natural', '0', '1'), (62, '3', 'Textit', '0', '1.45'), (63, '3', '6SA bílý', '0', '1.25'), (64, '3', 'PA6G natural', '0', '1.33'), (65, '4', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (66, '4', 'DuralQuality (ACP 5080)', '0', '2.7'), (67, '4', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (68, '4', 'Ocel (16MnCr5)', '0', '7.85'), (69, '4', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (70, '4', 'CuCrZr', '0', '8.89');
INSERT INTO `material` VALUES (71, '4', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (72, '4', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (73, '4', 'Bronz (CuSn)', '0', '8.7'), (74, '4', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (75, '4', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (76, '4', 'PE 1000 zelený', '0', '0.93'), (77, '4', 'PE 1000 natural', '0', '1'), (78, '4', 'Textit', '0', '1.45'), (79, '4', '6SA bílý', '0', '1.25'), (80, '4', 'PA6G natural', '0', '1.33');
INSERT INTO `material` VALUES (81, '5', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (82, '5', 'DuralQuality (ACP 5080)', '0', '2.7'), (83, '5', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (84, '5', 'Ocel (16MnCr5)', '0', '7.85'), (85, '5', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (86, '5', 'CuCrZr', '0', '8.89'), (87, '5', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (88, '5', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (89, '5', 'Bronz (CuSn)', '0', '8.7'), (90, '5', 'Nerez (RVS317, SS316, SS304)', '0', '7.85');
INSERT INTO `material` VALUES (91, '5', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (92, '5', 'PE 1000 zelený', '0', '0.93'), (93, '5', 'PE 1000 natural', '0', '1'), (94, '5', 'Textit', '0', '1.45'), (95, '5', '6SA bílý', '0', '1.25'), (96, '5', 'PA6G natural', '0', '1.33'), (97, '6', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (98, '6', 'DuralQuality (ACP 5080)', '0', '2.7'), (99, '6', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (100, '6', 'Ocel (16MnCr5)', '0', '7.85');
INSERT INTO `material` VALUES (101, '6', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (102, '6', 'CuCrZr', '0', '8.89'), (103, '6', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (104, '6', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (105, '6', 'Bronz (CuSn)', '0', '8.7'), (106, '6', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (107, '6', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (108, '6', 'PE 1000 zelený', '0', '0.93'), (109, '6', 'PE 1000 natural', '0', '1'), (110, '6', 'Textit', '0', '1.45');
INSERT INTO `material` VALUES (111, '6', '6SA bílý', '0', '1.25'), (112, '6', 'PA6G natural', '0', '1.33'), (113, '7', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (114, '7', 'DuralQuality (ACP 5080)', '0', '2.7'), (115, '7', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (116, '7', 'Ocel (16MnCr5)', '0', '7.85'), (117, '7', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (118, '7', 'CuCrZr', '0', '8.89'), (119, '7', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (120, '7', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45');
INSERT INTO `material` VALUES (121, '7', 'Bronz (CuSn)', '0', '8.7'), (122, '7', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (123, '7', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (124, '7', 'PE 1000 zelený', '0', '0.93'), (125, '7', 'PE 1000 natural', '0', '1'), (126, '7', 'Textit', '0', '1.45'), (127, '7', '6SA bílý', '0', '1.25'), (128, '7', 'PA6G natural', '0', '1.33'), (129, '8', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (130, '8', 'DuralQuality (ACP 5080)', '0', '2.7');
INSERT INTO `material` VALUES (131, '8', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (132, '8', 'Ocel (16MnCr5)', '0', '7.85'), (133, '8', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (134, '8', 'CuCrZr', '0', '8.89'), (135, '8', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (136, '8', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (137, '8', 'Bronz (CuSn)', '0', '8.7'), (138, '8', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (139, '8', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (140, '8', 'PE 1000 zelený', '0', '0.93');
INSERT INTO `material` VALUES (141, '8', 'PE 1000 natural', '0', '1'), (142, '8', 'Textit', '0', '1.45'), (143, '8', '6SA bílý', '0', '1.25'), (144, '8', 'PA6G natural', '0', '1.33'), (145, '9', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (146, '9', 'DuralQuality (ACP 5080)', '0', '2.7'), (147, '9', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (148, '9', 'Ocel (16MnCr5)', '0', '7.85'), (149, '9', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (150, '9', 'CuCrZr', '0', '8.89');
INSERT INTO `material` VALUES (151, '9', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (152, '9', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (153, '9', 'Bronz (CuSn)', '0', '8.7'), (154, '9', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (155, '9', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (156, '9', 'PE 1000 zelený', '0', '0.93'), (157, '9', 'PE 1000 natural', '0', '1'), (158, '9', 'Textit', '0', '1.45'), (159, '9', '6SA bílý', '0', '1.25'), (160, '9', 'PA6G natural', '0', '1.33');
INSERT INTO `material` VALUES (161, '10', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (162, '10', 'DuralQuality (ACP 5080)', '0', '2.7'), (163, '10', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (164, '10', 'Ocel (16MnCr5)', '0', '7.85'), (165, '10', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (166, '10', 'CuCrZr', '0', '8.89'), (167, '10', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (168, '10', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (169, '10', 'Bronz (CuSn)', '0', '8.7'), (170, '10', 'Nerez (RVS317, SS316, SS304)', '0', '7.85');
INSERT INTO `material` VALUES (171, '10', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (172, '10', 'PE 1000 zelený', '0', '0.93'), (173, '10', 'PE 1000 natural', '0', '1'), (174, '10', 'Textit', '0', '1.45'), (175, '10', '6SA bílý', '0', '1.25'), (176, '10', 'PA6G natural', '0', '1.33'), (177, '1', 'Dural (AlMgSi0,5; AlMgSi1)', '0', '2.7'), (178, '1', 'DuralQuality (ACP 5080)', '0', '2.7'), (179, '1', 'Ocel (St37; C45; 11SMn30) ', '0', '7.85'), (180, '1', 'Ocel (16MnCr5)', '0', '7.85');
INSERT INTO `material` VALUES (181, '1', 'Nástrojová ocel(WS1.2510)', '0', '7.85'), (182, '1', 'CuCrZr', '0', '8.89'), (183, '1', 'Měď (ECu57, ECu58, COPPER)', '0', '8.89'), (184, '1', 'Mosaz (MS58, MS63, BRASS, CuZn)', '0', '8.45'), (185, '1', 'Bronz (CuSn)', '0', '8.7'), (186, '1', 'Nerez (RVS317, SS316, SS304)', '0', '7.85'), (187, '1', 'Nástrojová ocel (WS1.2379)', '0', '7.85'), (188, '1', 'PE 1000 zelený', '0', '0.93'), (189, '1', 'PE 1000 natural', '0', '1'), (190, '1', 'Textit', '0', '1.45');
INSERT INTO `material` VALUES (191, '1', '6SA bílý', '0', '1.25'), (192, '1', 'PA6G natural', '0', '1.33');
INSERT INTO `operace` VALUES (138, 'T01@00002', 1, 'CNC soustruh (malý)', 5, 6, '03.2.2014', 0);
INSERT INTO `podnik` VALUES (1, 'unknown_name');
INSERT INTO `polotovar` VALUES (1, 3, 'Dural (AlMgSi0,5; AlMgSi1)', 1, '20x20x20', 'none');
INSERT INTO `sazba` VALUES (1, 'Fréza', 60, '0'), (2, 'CNC fréza (velká)', 60, '0'), (3, 'CNC fréza (malá)', 60, '0'), (4, 'CNC soustruh (malý)', 60, '0'), (5, 'Soustruh', 60, '0'), (6, 'Drátová řezačka', 60, '0'), (7, 'CNC fréza (pětiosá)', 60, '0'), (8, 'CNC soustruh (velký)', 60, '0'), (9, 'Fréza', 0, '1'), (10, 'CNC fréza (velká)', 0, '1');
INSERT INTO `sazba` VALUES (11, 'CNC fréza (malá)', 0, '1'), (12, 'CNC soustruh (malý)', 0, '1'), (13, 'Soustruh', 0, '1'), (14, 'Drátová řezačka', 0, '1'), (15, 'CNC fréza (pětiosá)', 0, '1'), (16, 'CNC soustruh (velký)', 0, '1');
INSERT INTO `tepelne_zpracovani` VALUES (1, 'elox', 10, 'Dural (AlMgSi0,5; AlMgSi1)');
INSERT INTO `vykresy` VALUES (1, 'T1', '00001', 'T1@00001', 1), (2, 'T2', '00001', 'T2@00001', 1), (3, 'T3', '00001', 'T3@00001', 1);
INSERT INTO `zakazky` VALUES (1, '00001', 1, 1);
INSERT INTO `zamestnanci` VALUES (1, 'aaa aaa', 1, 'aaa@aaa', 1), (2, 'bbb bbb', 1, 'bbb@bbb', 1), (3, 'ccc ccc', 1, 'ccc@ccc', 1);
při pokusu o nahrání mi databáze hlási toto:
[Err] 1064 - 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 ')
-- ----------------------------
-- Records
-- ----------------------------
' at line 1
[Err] )
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `firmy` VALUES (1, 'a');
[Msg] Finished - Unsuccessfully
--------------------------------------------------