I’m confused with MySQL. I’m querying a table with a primary key field called index.
SELECT * FROM content WHERE index = 7
Pretty simple right? I keep getting a syntax error though, around index = 7, error number 1064 (can’t paste the error as it’s on an iPhone simulator).
The field index contains a 7. It is the PRIMARY_KEY, and of type int(6)
The database works fine querying other fields and so on.
Are there settings I need to ensure are in place before I can query this field?
Much appreciated.
indexis a reserved word in MySQL. You have to escape it with backticks. See here