不正确的整数值:''对于第1行的列'ColorHair'

时间:2014-02-28 18:20:21

标签: php mysql

嘿所以得到这个错误

错误的整数值:''对于第1行的'ColorHair'列

任何人都可以帮助我或者为我解决这个问题:

  

$ sql2 = mysql_query(“INSERT INTO usersUsernamePasswordAccessActivationFlagAge,{{1 }},GenderEmailLevelGoldCoinsExpColorHairColorSkinColorEyeColorBaseColorTrimColorAccessoryDateCreatedLastLoginUpgradeExpireUpgradeDays,{ {1}},BankSlotsHouseSlotsBagSlotsHairIDHairFileHairNamePermamute,{{1 }},QuestsQuests2SettingsAchievementLastAreaCountryFounderGuildIDAchievementIDRankIDHouseInfoKillsDeathsGuildRankCurrentServerDailyQuest0,{ {1}},DailyQuest1DailyQuest2MonthlyQuest0)VALUES('$ username','$ pass1','1','5','15','$ gender ','$ email','1','0','0','0','$ haircolor','$ skincolor','$ eyecolor','0','0','0', '$ time','$ time','$ time',' - 1','0','10','40','$ hairid','$ hairfile','$ hairname','0' ,'00000000000000000000000000000000000000000000000000','00000000000000000000000000000000000000000000000000','0','0','','US','0','0','0','0','0','0','0 ','0','离线','','','','0','0','0','0','0');“)或死亡(”status = Error& strReason =“。mysql_error());

1 个答案:

答案 0 :(得分:1)

你的“ColorHair”列是整数类型,你传递一个空字符串的值:''

如果您的db字段对此字段接受null,您可以考虑在执行请求之前添加此行PHP:

$haircolor = intval($haircolor);