I think the table keeps being regenerated while making the login form using sqlite.(I'm a total beginner)

Asked 2 years ago, Updated 2 years ago, 65 views

.

sqlite database android

2022-09-22 12:38

1 Answers

Because INFO class checked if(database!=null), the CREATE syntax would have been executed only once.

The problem is that the setOnClickListener, which is called when you click the Join button in the Member class with the membership form, does not have a code to save the value in the DB. Cursor cursors = database.rawQuery("SELECT name, num, major FROM" + tableName, null); This code is the code that retrieves data values from a table. A code is required to store in DB required DB. database.execSQL("INSERT INTO PRODUCT(name, pass, write, num, major)" + "VALUES('Name', 'Pass', 'Write', 'Number', 'Major')"; you must include these values. Alternatively, you can use the ContentValues class to store values.

ContentValues newValues = new ContentValues();
newValues.put("name", "Google"); //In the column name of each table.
newValues.put("pass", "1234567");
// Adds a record.
database.insert ("PRODUCT"/*table name*/, null, newValues)


2022-09-22 12:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.