08-25-2013, 05:23 PM
Heres the correct tables......
Next time do the work .....
sql.Format( "INSERT INTO t_new_promoitem"
"(a_index, a_section_type, a_item_idx, a_item_count, a_item_plus, a_item_flag)"
" VALUES"
" ( %d, %d, %d, %d, %d, %d )", index, sectionType, itemidx, itemCount, itemPlus, itemFlag );
DROP TABLE IF EXISTS `t_new_promoitem`;
CREATE TABLE `t_new_promoitem` (
`a_index` int(11) NOT NULL AUTO_INCREMENT,
`a_section_type` int(11) NOT NULL DEFAULT 0,
`a_item_idx` int(11) NOT NULL DEFAULT 0,
`a_item_count` int(11) NOT NULL DEFAULT 0,
`a_item_plus` int(11) NOT NULL DEFAULT 0,
`a_item_flag` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`a_index`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
sql.Format( "INSERT INTO t_new_promotion "
"( a_index, a_enable, a_use_state, a_section_string, a_section_type, a_start_date, a_end_date, a_use_date, a_key_string ) "
" VALUES ( %d, %d, %d, %s, %d, %s, %s, %s, %s ) "
, index, Enable, Use, strSectionString, SectionType, strStartDate, strEndDate, strUseDate, strKey );
DROP TABLE IF EXISTS `t_new_promotion`;
CREATE TABLE `t_new_promotion` (
`a_index` int(11) NOT NULL AUTO_INCREMENT,
`a_enable` int(11) DEFAULT NULL,
`a_use_state` int(11) DEFAULT NULL,
`a_section_string` varchar(255) DEFAULT NULL,
`a_section_type` varchar(255) DEFAULT NULL,
`a_start_date` datetime DEFAULT NULL,
`a_end_date` datetime DEFAULT NULL,
`a_use_date` datetime DEFAULT NULL,
`a_key_string` varchar(255) DEFAULT NULL,
PRIMARY KEY (`a_index`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

