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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:44:52+00:00 2026-05-26T23:44:52+00:00

I am facing a really weird error,while trying to insert into a table called

  • 0

I am facing a really weird error,while trying to insert into a table called “my_card”.

These are some constants I defined in a separate interface:

//tables name
public static final String TABLE_MY_CARD= "my_card" ;
public static final String TABLE_MY_CONTACTS = "my_contacts" ;

// Columns
public static final String NAME = "name" ;
public static final String PHONE = "phone" ;
public static final String EMAIL = "email";

public static final String FACEBOOK = "facebook";
public static final String WEBSITE = "web";
public static final String MAJOR = "major";
public static final String ULINK = "ulink";

After that I have a class which extends SQLiteOpenHelper, with 2 functions. The most important is the first one which creates the table given by a parameter.

public class MySQLite_methods extends SQLiteOpenHelper implements Tables {

private static final String DATABASE_NAME = "my_database.db" ;
private static final int DATABASE_VERSION = 1;
private String TABLE_NAME;

/** Create a helper object for the Events database */
public MySQLite_methods (Context ctx, String table_name) 
{
    super(ctx, DATABASE_NAME, null, DATABASE_VERSION);
    this.TABLE_NAME = table_name;
}

@Override
public void onCreate(SQLiteDatabase db) 
{       
    String sql = "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + 
                    " (" + _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +               
                    NAME + " TEXT NOT NULL," + 
                    PHONE + " TEXT NOT NULL,"+
                    EMAIL + " TEXT NOT NULL,"+                      
                    FACEBOOK + " TEXT,"+
                    WEBSITE + " TEXT,"+
                    MAJOR + " TEXT NOT NULL,"+
                    ULINK + " TEXT NOT NULL" + ");" ;

    db.execSQL(sql);
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
{
    db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
    onCreate(db);
}
}

And finally, in my activity, after pressing a button for save, an instance of the class will be created and the values of some EditText-s have to be inserted into the database:

            MySQLite_methods mysql = new MySQLite_methods (context, TABLE_MY_CARD);


            Log.d("geo", "before getWr....");

            // getting the database..
            SQLiteDatabase db = mysql.getWritableDatabase();

            // creating an object of type ContentValues which represents the record i am gonna add into the DB
            ContentValues values = new ContentValues();

            values.put(NAME, name.getText().toString());
            values.put(PHONE, phone.getText().toString());
            values.put(EMAIL, email.getText().toString());

            values.put(FACEBOOK, facebook.getText().toString());
            values.put(WEBSITE, website.getText().toString());
            values.put(MAJOR, major.getText().toString());
            values.put(ULINK, ulink.getText().toString());

            Log.d("geo", "before insert");

            // inserting data
            db.insertOrThrow(TABLE_MY_CARD, null, values);

At the moment of the insert it gives this exception:

“android.database.sqlite.SQLiteException: table my_card has no column named web ….”

I checked over and over again for typo mistakes, but none… So i dont know what to do now… Any idea?
Thank you

  • 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-26T23:44:53+00:00Added an answer on May 26, 2026 at 11:44 pm

    Your create SQL starts with CREATE TABLE IF NOT EXISTS. So my idea is you added web column while the device has already had that table. If this is the case then just reinstall the app – it will delete the DB, so you can be sure the table will be created with that column.

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

Sidebar

Related Questions

this time, I'm facing a really weird problem. I've the following code: $xml =
I am facing a really weird problem. I am using swfupload to upload multiple
I'm developing a website in Brazilian Portuguese and I'm facing some really annoying encoding
I am really really tired these day because of facing this problem. I am
I'm facing a very weird kind of problem while running my application. When I
I´m currently facing a really weird (at least for me) problem regarding the configuration
I am facing a really tough time doing this. I haven't done much on
Im facing some problems, I looked around in the forum and didnt find any
I'm facing a problem that's really strange. It's in every browser. Everything is working
I'm fixing a program but I'm facing a problem and I cant really realize

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.