mysql query error in php
When I try execute query in mysql console - it's execute succesful, but in php it doesn't work. In php return error: Unknown column 'users.pwd' in 'field list'
Query:
SELECT users.`login`,
users.`name`,
users.`pwd`,
users.`grp`,
us开发者_运维知识库ers.`email`,
users.`status`,
users.`lang_id`,
users.`tmst`,
users.`id`
FROM
users
WHERE users.`pwd` = '5d872b11ff7916c18052c6a4e50e8558'
AND
users.`login` = 'admin'
Try the query without the user word, it's not need when you select columns from a single table.
SELECT `login`,
`name`,
`pwd`,
`grp`,
`email`,
`status`,
`lang_id`,
`tmst`,
`id`
FROM `users` WHERE `pwd`='5d872b11ff7916c18052c6a4e50e8558' AND `login`='admin'
Or use:
SELECT * FROM `users` WHERE `pwd`='5d872b11ff7916c18052c6a4e50e8558' AND `login`='admin'
精彩评论