0

I am trying to select all rows that have "helloworld" in "category" column. Here is my query:

SELECT * FROM `commands` WHERE `category` = `helloworld`

I get this error:

Unknown column 'helloworld' in 'where clause'

I would appreciate any help.

3 Answers 3

4

Try with

SELECT * FROM `commands` WHERE `category` = 'helloworld'

instead. Note the ' around helloworld instead of `

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

Comments

0

I think you don't need to have '' fields that are non - variables. Just try this ;

SELECT * FROM commands WHERE category = "helloworld"

Comments

0

That should be

SELECT * FROM `commands` WHERE `category` = 'helloworld'

Note the difference in quotes. Strings are quoted with ' while table/column names can optionally be quoted with ` to avoid being interpreted as keywords.

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.