title: How do I select rows from table?
body: <p>I'm making an app where MainActivity has a RecyclerView that contains the user's lists e.g. grocery list, weekly list, etc.</p>
  <p>When the user clicks on an item, it'll navigate to products activity also has a RecyclerView. I have 2 different SQLite databases 1:lists 2:products.</p>
  <p>The logic I used is when a user adds a list, the lists database will record list name and id, also adds list name in products database, and when user add product, I used <code>update()</code> instead of <code>insert()</code> in <code>SQLite</code> because the column already exists, so product name and id will be updated in the product database.</p>
  <p>This is the structure of the list and product table:</p>
  <pre><code>LISTS
  
    ID      LIST_NAME
  
  1  1       list 1
  2  2       list 2
  
  PRODUCTS
  
    ID      LIST_NAME    PRODUCT_NAME
  
  1  1       list 1     product1 in list1
  2  2       list 1     product2 in list1
  </code></pre>
  <p>the problem is when I add a list then navigate to products I see this error :</p>
  <pre><code>android.database.sqlite.SQLiteException: no such column: list (Sqlite code 1 SQLITE_ERROR): , while compiling: SELECT * FROM prducts WHERE LIST_NAME = list, (OS error - 2:No such file or directory) 
  </code></pre>
  <p>this is the method inside <code>SQLiteOpenHelper</code> and the error shows in this line: <code>cursor = db.rawQuery(productsQuery, null);</code></p>
  <pre><code>public Cursor getAllProducts(String list_name)
      {
          SQLiteDatabase db = this.getReadableDatabase();
          Cursor cursor = null;
  
          if (db != null)
          {
              String productsQuery = &quot; SELECT * FROM &quot; +DB_TABLE+ &quot; WHERE &quot;+LIST_NAME_COLUMN+ &quot; = &quot;+list_name;
              cursor = db.rawQuery(productsQuery, null);
          }
          return cursor;
      }
  </code></pre>
  <p>in product activity i used <code>Bundle bundle = getIntent().getExtras();</code> to pass the list name from list activity. and in list activity i used <code>intent.putExtra(&quot;list_name&quot;, list_name);</code></p>