blunerve09 Posted September 18, 2007 Share Posted September 18, 2007 I am having problems running a query to select a username and password out of a database to log the user in. It keeps coming up with the error "unknown column 'user' in 'where clause'. I've tried to wrap the variables in quotes, but it's still not working. If i use the same query on the command line, it works, just not through the web. Here's the code: $sqluser = addslashes($user); $sqlpass = addslashes($pass); $query = "SELECT username FROM dig_data WHERE username='$sqluser' AND password=PASSWORD('$sqlpass')"; $authuser = dbquery($query); Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/69753-unknown-column/ Share on other sites More sharing options...
sasa Posted September 18, 2007 Share Posted September 18, 2007 check your typo in line $query = ... db reports that you ask for column 'user' bat in your query i see 'username' Quote Link to comment https://forums.phpfreaks.com/topic/69753-unknown-column/#findComment-350465 Share on other sites More sharing options...
blunerve09 Posted September 18, 2007 Author Share Posted September 18, 2007 ok, I changed the structure of the database, and changed the query, but it's still showing the same error. Quote Link to comment https://forums.phpfreaks.com/topic/69753-unknown-column/#findComment-350475 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.