0

my table 'users' have a following schema

| id | name | class|

| 0 | John | Primary | | 1 | Mary | Primary |

I tried this query:

select * from users where id = 'a'

The mysql return all rows from table.

How can I solve this problem?

1
  • 1
    What do you want to achieve? Commented Feb 26, 2014 at 21:09

1 Answer 1

1

If id is of type Integer, you have to type it without quotation marks. For example:

select * from users where id = 0;

should return:

| 0 | John | Primary

However, the 'a' in your example is not an Integer, so I am not 100 percent sure where this comes from and if I understood you correctly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.