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)
© 2024 OneMinuteCode. All rights reserved.