-2

I'm working on the following project: http://lpmj.net/20.php

I've made several entries into phpMyadmin and am getting used to making the mySQL and php correspond, but with this error i have no idea what the code is asking for.

This is the error i'm recieving:

Unknown column 'userpass' in 'field list'

Any help what this is indicating would be appreciated.

4
  • 1
    Can you show the query and database structure? That error occurs when you are trying to select from a column that doesn't exist.
    – Jivings
    Jan 18, 2012 at 0:23
  • 1
    can you post your PHP code which connectes the DB?
    – John Woo
    Jan 18, 2012 at 0:24
  • 1
    there is likely a mismatched apostrophe in your query. I would do a <?php var_dump($myqryhere); ?> to see what the queries you have are actually doing, and likely there is a field without any content, or the content is not escaped correctly (contains a comma). This makes the query unable to find the field it it looking for.
    – Ryan
    Jan 18, 2012 at 0:27
  • 1
    The error message is self explanatory, you'll need to provide a code snippet in order for anyone to offer a solution to your overall problem.
    – CBusBus
    Jan 18, 2012 at 0:35

2 Answers 2

3

This means that your field-list — the stuff right after the word SELECT — refers to a column named userpass, but that that column doesn't exist in the table(s) you're selecting from. For example, maybe your query looks like this:

SELECT userpass FROM foo;

when it should actually look like one of these:

SELECT userpass FROM bar;  -- was looking in the wrong table
SELECT user_pass FROM foo; -- mistyped the name of the column
3

It means userpass does not exist. Check your spelling and make sure it does in fact exist

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.