0

向表中插入数据的查询打破了编码流程。

如何摆脱这个异常:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'annual_spend'

代码:

INSERT INTO {mc_reward_accelarators} (`nid`,`reward_type_id`,`reward_level`,          `percentage_spend`,`accelerator`,`annual_spend`,`inc_bonus_perce`,`first_year`,`language`) VALUES ('25','0','0','0','HP','','','0','en'),('25','0','0','0','FP','','','','en');
4

1 回答 1

1

试试这个

INSERT INTO {mc_reward_accelarators} 
(
    `nid`,
    `reward_type_id`,
    `reward_level`,
    `percentage_spend`,
    `accelerator`,
    `annual_spend`,
    `inc_bonus_perce`,
    `first_year`,
    `language`
) 
VALUES 
(
    25,0,0,0,HP,,,0,en
),
(
    25,0,0,0,FP,,,,en
);

避免在值中使用 (')。

于 2013-07-18T11:24:27.443 回答