关于网友提出的“ mysql语句错误”问题疑问,本网通过在网上对“ mysql语句错误”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: mysql语句错误
描述:SELECT
user.user_id,
user.nickename,
user.truename,
user.sex,
user.headimg,
user.bank,
user.banktype,
user.phonenumber,
user.password,
user.credit_line,
user.while_line,
user.rating,
user.token,
profile.id AS profile__id,
profile.user_id AS profile__user_id,
profile.contact AS profile__contact,
profile.come AS profile__come,
profile.marriage AS profile__marriage,
profile.job AS profile__job,
profile.edu AS profile__edu,
profile.adress AS profile__adress
FROM
user user
INNER JOIN profile profile ON user.user_id = profile.user_id
WHERE
user.user_id = 1
LIMIT
1

哪里出错了,字段名是没写错的。但是一直报错...
好像有

这两个字段就会报错 这是什么原因?
解决方案1:在catch块里把PDOException打出来看看
echo $e->getMessage()." \n ".$e->getTraceAsString();
解决方案2:虽然不知道什么情况,但是把这两个字段删了就好了
以上介绍了“ mysql语句错误”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/4535031.html