不正确的整数值:第 1 行的“ColorHair"列的“" [英] Incorrect integer value: '' for column 'ColorHair' at row 1
问题描述
嘿,我收到这个错误
不正确的整数值:''用于第 1 行的 'ColorHair' 列
Incorrect integer value: '' for column 'ColorHair' at row 1
任何人都可以帮我或给我一个修复这个 D:
Can anybody please help me or give me a fix for this D:
$sql2 = mysql_query("INSERT INTO users
(Username
, Password
, Access
, ActivationFlag
、Age
、Gender
、Email
、Level
、Gold
、Coins
、Exp
、ColorHair
、ColorSkin
、ColorEye
、ColorBase
、ColorTrim
、ColorAccessory
、DateCreated
、LastLogin
、UpgradeExpire
、UpgradeDays
、BankSlots
、HouseSlots
、BagSlots
、HairID
、HairFile
、HairName
、Permamute
、Quests
、Quests2
、Settings
、成就
、LastArea
、Country
、创始人
、GuildID
、AchievementID
、RankID
、HouseInfo
、Kills
、Deaths
、GuildRank
、CurrentServer
、DailyQuest0
、DailyQuest1
、DailyQuest2
、MonthlyQuest0
, Upgraded
, XpBoost
, CpBoost
, GoldBoost
) 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', '', '美国', '0', '0',' 0', '0', '0', '0', '0', '0', '离线', '', '', '', '0', '0', '0', '0', '0');") 或 die("status=Error&strReason=" .mysql_error());
$sql2 = mysql_query("INSERT INTO
users
(Username
,Password
,Access
,ActivationFlag
,Age
,Gender
,Level
,Gold
,Coins
,Exp
,ColorHair
,ColorSkin
,ColorEye
,ColorBase
,ColorTrim
,ColorAccessory
,DateCreated
,LastLogin
,UpgradeExpire
,UpgradeDays
,BankSlots
,HouseSlots
,BagSlots
,HairID
,HairFile
,HairName
,Permamute
,Quests
,Quests2
,Settings
,Achievement
,LastArea
,Country
,Founder
,GuildID
,AchievementID
,RankID
,HouseInfo
,Kills
,Deaths
,GuildRank
,CurrentServer
,DailyQuest0
,DailyQuest1
,DailyQuest2
,MonthlyQuest0
,Upgraded
,XpBoost
,CpBoost
,GoldBoost
) 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', 'Offline', '', '', '', '0', '0', '0', '0', '0');") or die("status=Error&strReason=" . mysql_error());
推荐答案
您的ColorHair"列是整数类型,您将空字符串的值传递给它:''
Your "ColorHair" column is of type integer, and you pass it the value of an empty string : ''
如果您的 db 字段接受此字段的 null,您可以考虑在执行请求之前添加这一行 PHP :
If your db field accept null for this field you may consider adding this line of PHP before doing your request :
$haircolor = intval($haircolor);
这篇关于不正确的整数值:第 1 行的“ColorHair"列的“"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!