MySQL INSERT falls nicht vorhanden (ohne Primärschlüssel)
Wie kann ich in eine Zeile einfügen, wenn diePaar ist nicht vorhanden?
* HINWEIS: Dies sind keine Primärschlüssel. Mein Primärschlüssel ist auf automatische Inkrementierung eingestellt
habe versucht, das Einfügen zu ignorieren, aber es hat nicht funktioniert
INSERT IGNORE INTO mytable (`myid`, `theirid`) VALUES ('5', '1')
ON DUPLICATE KEY <DO NOTHING>
Tabelle sieht aus wie:
CREATE TABLE `mytable` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`myid` bigint(20) NOT NULL,
`theirid` bigint(20) NOT NULL,
`activated` tinyint(1) NOT NULL DEFAULT '0',
`dateStamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1$