@Override
public void onCreate(SQLiteDatabase db) {
Log.wtf("x", " database CREATED!!! -------------------------");
db.execSQL("create table userData ("
+ "id integer primary key autoincrement,"
+ "name text,"
+ "password text,"
+ "hero1_score int,"
+ "hero2_score int,"
+ "hero3_score int,"
+ "hero4_score int,"
+ "hero5_score int" //forget comma here - what happens?
+ "loggedin int"
+ ");");
When i try to add row in my userData table, it gives me error : "can't find loggedin column" , I recognized the error was this simple comma. Apparently, any other stuff that goes after last comma is not included in actual sql command "CREATE TABLE".
Can someone explain why this is like that?
Aucun commentaire:
Enregistrer un commentaire