SELECT COUNT(*) as total FROM case
Static analysis: 1 errors were found during analysis. Unexpected end of CASE expression (near "" at position 0) SQL query: Documentation SELECT COUNT(*) as total FROM case MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case' at line 1
caseis a really poor name for a table or column name. It is obviously a SQL keyword. But, if you can't fix it, use backticks:
I would encourage you to figure out how the database can be fixed. I generally name tables in the plural --
casesfor instance. First, they are plural because they almost always have more than one row. A side effect is that plurals conflict with many fewer keywords.