quentin dufosse
quentin dufosse

Reputation: 51

SQLite database - only one table was created

I have a problem with my database in android with the following code :

db.beginTransaction();

db.execSQL("Create table Utilisateurs (pseudo TEXT PRIMARY KEY,password TEXT, point INTEGER;");

db.execSQL("Create table tournois(nom TEXT PRIMARY KEY);");

db.execSQL("Create table Equipe(idEquipe INTEGER PRIMARY KEY AUTOINCREMENT, nomEquipe TEXT, abrEquipe TEXT);");

So, there is some table created. My first table allow user to connect. There is no error around here. After that one, i created a cursor to get any tournament. (i wont show insert code exept you want it personnaly.)

Cursor c = null;

c = db.query("tournois", new String[]{"nom"}, null, null, null, null, null);

That cursor would have every tournament name taken. But i try to show the cursor count and he send back a 0. I tried every other table, only the 'utilisateurs' is not empty.

(Even the insert must tell there is an error, but it doesn't for any reason.)

I'm stuck at the point for a moment. If anyone could help or want more code to help, i can send it.

I hope some help around here. Thanks. (here's my translate)

Upvotes: 2

Views: 713

Answers (1)

quentin dufosse
quentin dufosse

Reputation: 51

Ok, i got it. It was my insert. I was doing ll insert in one request. And it wasn't working.

I feel bad about loosing so much time on this. Thanks for your comment, i saw where was my dumb error.

Thanks

Upvotes: 1

Related Questions