Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7577347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:09:44+00:00 2026-05-30T17:09:44+00:00

I’m try to access a database which was working fine (until i added more

  • 0

I’m try to access a database which was working fine (until i added more fields and updated the code accordingly).

I get this error:

Caused by: android.database.sqlite.SQLiteException: near ",": syntax error: , while compiling: SELECT _id, title, description, locations, datesTimes, added, provider, url, cast, director, runningTime, certification, imageUrl, trailerUrl FROM films ORDER BY _id DESC

Here is the code for the query:

public Cursor getAllTitles()
    {
    return myDataBase.query("films", new String[] {
    KEY_ROWID,
    KEY_TITLE,
    KEY_DESCRIPTION,
    KEY_LOCATIONS,
    KEY_DATESTIMES,
    KEY_ADDED,
    KEY_PROVIDER,
    KEY_URL,
    KEY_CAST,
    KEY_DIRECTOR,
    KEY_RUNNINGTIME,
    KEY_CERTIFICATION,
    KEY_IMAGEURL,
    KEY_TRAILERURL},
    null,
    null,
    null,
    null,
    KEY_ROWID + " DESC"); //Sort the data using the Primary Key in descending order . . meaning last added is shown first.
    }

And here the code for extracting data from the database:

    //---Get all records from database---
    myDbHelper.openDataBase();
    cursorPosition = myDbHelper.getAllTitles();

    if (cursorPosition.moveToFirst())
    {
    do {
        AddRecordToArray(cursorPosition);
    } while (cursorPosition.moveToNext());
    }
        myDbHelper.close();
    }

    public void AddRecordToArray(Cursor cursorPosition)
    {

        //Add new record to array (which gets data from database using cursorPosition (for current row) and .getstring( for column number).
        final FilmRecord film1 = new FilmRecord(cursorPosition.getString(1), cursorPosition.getString(4), cursorPosition.getString(5), cursorPosition.getString(3), cursorPosition.getString(2), cursorPosition.getString(6), cursorPosition.getString(7), cursorPosition.getString(8), cursorPosition.getString(9), cursorPosition.getString(10), cursorPosition.getString(11), cursorPosition.getString(12), cursorPosition.getString(13));
        films.add(film1);

        myDbHelper.close();
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (myDbHelper != null) {
            myDbHelper.close();
        }

    }

If there is any more information required to solve this error just let me know what you need.
I’m really confused with the “,”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:09:45+00:00Added an answer on May 30, 2026 at 5:09 pm

    “cast” is a reserved word. Try changing that column name, or quoting it. http://www.sqlite.org/lang_keywords.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have a reasonable size flat file database of text documents mostly saved in
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.