Wie ignoriere ich automatisch erhöhte primäre ID auf myIsam Einfügen ignorieren? Wie löst man dieses Problem? Dies ist schnell primäre ID erhöht. Wie lösen diesesWie Ignoriere automatisch erhöhte primäre ID auf myIsam Einfügen ignorieren?
MY TABLE STRUKTUR
| dates_tbl | CREATE TABLE `dates_tbl` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`date_raw` int(8) unsigned NOT NULL DEFAULT '0',
`date` date NOT NULL DEFAULT '0000-00-00',
`day` tinyint(2) unsigned NOT NULL DEFAULT '0',
`week` tinyint(2) unsigned NOT NULL DEFAULT '0',
`month` tinyint(2) unsigned NOT NULL DEFAULT '0',
`year` year(4) NOT NULL DEFAULT '0000',
`created_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `date_raw_unique` (`date_raw`),
KEY `date_raw` (`date_raw`),
KEY `month_year` (`month`,`year`),
KEY `year` (`year`)
) ENGINE=InnoDB AUTO_INCREMENT=21628 DEFAULT CHARSET=latin1 |
INSERT QUERY
$q = "INSERT IGNORE INTO dates_tbl(date_raw,date,day,week,month,year,created_on)
values $dynamic_value";
RESULT
mysql> select id from dates_tbl limit 10;
+-------+
| id |
+-------+
| 19657 |
| 19681 |
| 19729 |
| 19777 |
| 19825 |
| 19873 |
| 19884 |
| 19913 |
| 19960 |
| 20007 |
+-------+
10 rows in set (0.01 sec)
Was soll diese Tabelle darstellen? – duskwuff