1
votes

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)

1
Bonjour Quentin. Ce site est destiné à être utilisé en anglais. Je te prierais de réécrire ta question en anglais. To fellow SO users, this question may not be bad, it's just in french (!). OP is being told it should be in english - Félix Adriyel Gagnon-Grenier
What does your insert code look like for the tournois table? - Michael Krause

1 Answers

1
votes

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