我有下表,属性如下
CREATE TABLE `test` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`active` varchar(4) CHARACTER SET latin1 DEFAULT NULL,
`von` date DEFAULT NULL,
`bis` date DEFAULT NULL,
`rabatt` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`code` varchar(64) CHARACTER SET latin1 DEFAULT NULL,
`text_kurz` text CHARACTER SET latin1,
`linkname` varchar(1024) CHARACTER SET latin1 DEFAULT NULL,
`link` varchar(2048) CHARACTER SET latin1 DEFAULT NULL,
`special` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`type` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`hersteller` varchar(128) CHARACTER SET latin1 DEFAULT NULL,
`smb` smallint(1) DEFAULT NULL,
`dhs` smallint(1) DEFAULT NULL,
`sidebar` varchar(4) CHARACTER SET latin1 DEFAULT 'ja',
`img_tag` text CHARACTER SET latin1,
`dm_bild` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `von` (`von`),
KEY `bis` (`bis`),
KEY `type` (`type`),
KEY `active` (`active`),
KEY `code` (`code`),
FULLTEXT KEY `Volltext` (`text_kurz`)
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8
我想用php插入德语格式的unix时间戳我一直在尝试以下
$time = "1057941242";
$qry = 'INSERT INTO test (active, von, bis, rabatt, code, text_kurz)
VALUES("ja",FROM_UNIXTIME('.$gutschein->startDate.'),
FROM_UNIXTIME('.$gutschein->endDate.'),
"'.$gutschein->title.'",
"'.$gutschein->code.'",
"'.$gutschein->shortDescription.'")'