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 9036735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:04:32+00:00 2026-06-16T09:04:32+00:00

After trying to get a text from the database i got this error: 12-21

  • 0

After trying to get a text from the database i got this error:

12-21 09:54:10.948: E/AndroidRuntime(25745): FATAL EXCEPTION: main
12-21 09:54:10.948: E/AndroidRuntime(25745): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ggservice.democracy/com.ggservice.democracy.sondaggioActivity}: android.database.sqlite.SQLiteException: near "=": syntax error: , while compiling: SELECT _id, preferita, nome FROM sondaggi WHERE _id=

this is the call:

Cursor values = datasource.getDomanda(strcategory );
        if (values.moveToFirst()) // data?
               System.out.println(values.getString(values.getColumnIndex("domanda"))); 

               values.close(); 

And it calls this:

public Cursor getDomanda(String id) {
            List<sondaggi> domande = new ArrayList<sondaggi>();

            Cursor cursor = database.query(MySQLiteHelper.TABLE_SONDAGGI,
                    allCategorieColumns, MySQLiteHelper.COLUMN_ID + "=", new String[] { id }, null, null, null);

            cursor.moveToFirst();
            while (!cursor.isAfterLast()) {
              sondaggi sondaggio = cursorToSondaggi(cursor);
              domande.add(sondaggio);
              cursor.moveToNext();
            }

            return cursor;
          }

the id seams empty, but i know there is a value there, i have tested the variable passage. i mean, if i Toast the strcategory it return the right value.

  • 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-06-16T09:04:33+00:00Added an answer on June 16, 2026 at 9:04 am

    Chnage

      Cursor cursor = database.query(MySQLiteHelper.TABLE_SONDAGGI,
                        allCategorieColumns,
                        MySQLiteHelper.COLUMN_ID + "=",
                        new String[] { id }, null, null, null);
    

    to

      Cursor cursor = database.query(MySQLiteHelper.TABLE_SONDAGGI,
                        allCategorieColumns,
                        MySQLiteHelper.COLUMN_ID + "=?",
                        new String[] { id }, null, null, null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've trying to get some vertical text on a little test webpage after reading
I've been trying to get a script that inserts a div of text after
I'm trying to insert text into a MySQL DataBase from a form using PHP.
I'm trying to get some text from a large text file, the text I'm
Hi I'm trying to get the text from a clicked word in between <li>
After trying to get the mercurial repository explorer setup on my shared hosting with
I am trying to get the value of javascript pop-up after using file_get_contents .
I'm trying to get the size of my UIView after the orientation changes. In
I'm trying to get my application to perform an action after a delay, but
I'm trying to get java to perform one action after one click and then

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.