SQLite Question: How to only show the elements I want

Run into another roadblock with SQLite. I want to only display those items that were “selected”, but I’m getting an error so something is not right. Any help would be appreciated. Thanks!

mSQLString = "SELECT " + COL_EQUIPMENT_INCLUDE + " FROM " + SQL_TABLE_THE_EQUIPMENT + " WHERE" + COL_EQUIPMENT_INCLUDE + " ="  + "1" + "";

When an item is selected via a toggle, it’s saved to the database as a 0 or 1. I only want to show those that have the 1 in that column. The output shows all items both those that are selected and those that are not.

If you write out the value of the mSQLString, you’ll see that you have (at least) a spacing problem behind your “WHERE” keyword (it runs right into the column name). That said, you didn’t mention what the actual error is, so I’m just guessing.

Anyway, print out your constructed string to see it in its final form and fix the spacing issues.