Eroare la Insert date in MySQL
Scris: Mie Feb 29, 2012
Salutare. Am si eu un query si sunt nelamurit de ce nu merge.
Eroarea primita:
Daca vreau sa fac insert la alt tabel merge.
SQL SERVERS:
SQL VOTURI:
Eu lucrez fara ghilimele, da nu inteleg de ce nu merge primul query, cel cu servers.
Cod: Selectaţi tot
INSERT INTO servers (ip, mod, port, voturi) VALUES ('192.168.1.64', 'clasic', '27015', '1')
Cod: Selectaţi tot
#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 'mod, port, voturi) VALUES ('192.168.1.64', 'clasic', '27015', '1')' at line 1
Cod: Selectaţi tot
INSERT INTO voturi (ip, timp, vot_pentru) VALUES ('192.168.1.64', NOW(), 'admin')
Cod: Selectaţi tot
CREATE TABLE IF NOT EXISTS `servers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(64) NOT NULL,
`mod` varchar(64) NOT NULL,
`port` int(10) NOT NULL,
`voturi` int(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
Cod: Selectaţi tot
CREATE TABLE IF NOT EXISTS `voturi` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(64) NOT NULL,
`timp` varchar(64) NOT NULL,
`vot_pentru` varchar(25) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;