0

所以,我有这个:

$newModel = "UPDATE models SET firstname=" . PrepSQL($firstname) . ", lastname=" . PrepSQL($lastname) . ", email=" . PrepSQL($email) . ", password=" . PrepSQL($password) . ", \"group\"=" . PrepSQL($group) . ", phone=" . PrepSQL($phone) . ", timeofday=" . PrepSQL($timeofday) . ", dayofweek=" . PrepSQL($dayofweek) . ", address=" . PrepSQL($address) . ", city=" . PrepSQL($city) . ", state=" . PrepSQL($state) . ", zip=" . PrepSQL($zip) . ", gender=" . PrepSQL($gender) . ", hair=" . PrepSQL($hair) . ", eye=" . PrepSQL($eye) . ", birthday=" . PrepSQL($birthday) . ", birthmonth=" . PrepSQL($birthmonth) . ", birthyear=" . PrepSQL($birthyear) . ", bustshirt=" . PrepSQL($bustshirt) . ", cup=" . PrepSQL($cup) . ", waist=" . PrepSQL($waist) . ", hips=" . PrepSQL($hips) . ", weight=" . PrepSQL($weight) . ", inches=" . PrepSQL($inches) . ", dressjacket=" . PrepSQL($dressjacket) . ", workxp=" . PrepSQL($workxp) . ", twitter=" . PrepSQL($twitter) . ", facebook=" . PrepSQL($facebook) . ", joindate=" . PrepSQL($joindate) . ", instagram=" . PrepSQL($instagram) . ", imdb=" . PrepSQL($imdb) . ", parentid=" . PrepSQL($parentid) . ", ethnicity=" . PrepSQL($ethnicity) . ", error='' WHERE id=" . $inserted_id;

解释后是这样的:

UPDATE models SET firstname='This', lastname='Person', email='rbross3333@gmail.com', password='gwpmgca8', "group"='1', phone='1234123412', timeofday='', dayofweek='', address='1234 Fictional', city='City', state='AL', zip='12345', gender='1', hair='blonde', eye='', birthday='08/06/1993', birthmonth='', birthyear='', bustshirt='', cup='', waist='12', hips='12', weight='12', inches='', dressjacket='12', workxp='', twitter='', facebook='', joindate='2013-09-04 17:11:34', instagram='', imdb='', parentid='', ethnicity='african-american', error='' WHERE id=346"

当我将解释的查询放在这里时:

http://developer.mimer.com/validator/parser200x/index.tml#parser

它验证。

当我将它直接放入 phpmyadmin 时,我得到:

在此处输入图像描述

那么如何正确传递字段名称group(“组”?)?

4

1 回答 1

1

尝试使用反引号 `` 而不是 group 周围的引号。

像这样:

`group` = 1
于 2013-09-05T00:53:14.447 回答