PhpMyAdmin不接受经过验证的MySQL查询

时间:2013-09-05 00:48:36

标签: php mysql phpmyadmin

所以,我有这个:

$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时,我得到:

enter image description here

那么如何通过?

正确传递字段名称group(“group”?)

1 个答案:

答案 0 :(得分:1)

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

像这样:

`group` = 1