mysql_query("
INSERT INTO `vl.maindb`
(`nickname`,
`firstname`,
`middlename`,
`lastname`,
`day`,
`month`,
`year`,
`email`,
`password`,
`questionkey`,
`questionans`,
`pclass`,
`smoney`,
`cmoney`,
`job`,
`jobplace`,
`health`,
`armor`,
`mag`,
`ammo`,
`jobexperience`,
`jobsalary`,
`bankid`,
`cweapon`)
VALUES ('$nickname',
'$firstname',
'$middlename',
'$lastname',
'$day',
'$month',
'$year',
'$email',
'$password2',
'$questionkey',
'$questionans',
'$pclass',
'$smoney',
'$cmoney',
'$job',
'$jobplace',
'$health',
'$armor',
'$mag',
'$ammo',
'$obexperience',
'$jobsalary',
'$bankid,
'$cweapon')");
另一种阅读v
的方法谁能告诉我什么错了?我找不到问题。我需要帮助我的PHP所以当我点击注册它将输入一个新的SQL查询mysql_query(" INSERT INTO
vl.maindb
(nickname
,firstname
,middlename
,lastname
,day
,month
,year
,password
,questionkey
,questionans
,pclass
,smoney
,cmoney
,job
,jobplace
,health
,armor
,mag
,ammo
,jobexperience
,jobsalary
,bankid
,cweapon
)价值观(' $昵称',' $ firstname', ' $ middlename',' $ lastname',' $ day',' $ month',' $ year', ' $电子邮件&#39 ;, ' $ password2',' $ questionkey',' $ questionans',' $ pclass',' $ smoney', ' $ cmoney',' $ job',' $ jobplace',' $ health',' $ armor', ' $ mag',' $ ammo', ' $ obexperience',' $ jobsalary',' $ bankid,' $ cweapon')");
答案 0 :(得分:4)
您在'$bankid
你绝对应该迁移到mysqli,因为不推荐使用mysql函数。 另外,在PHP查询中使用预准备语句;这样可以防止SQL注入,也可以限制上面描述的错误