22 Jun 2013, 18:35
Generic-user-small

Andreas Knaup (9 posts)

Hello,

i did little sketch, here’s:

Before setup:

import ketai.data.*;

KetaiSQLite db;

import ketai.data.*;

KetaiSQLite db; String CREATE_DB_SQL = “CREATE TABLE data ( _id INTEGER PRIMARY KEY AUTOINCREMENT, punkte INTEGER NOT NULL DEFAULT ‘0’, level INTEGER NOT NULL DEFAULT ‘0’);”;

in setup():

db = new KetaiSQLite( this); db.connect();

if (!db.tableExists(“data”)){ db.execute(CREATE_DB_SQL);} db.query( “SELECT * FROM data” ); while (db.next()) { level=db.getInt(“punkte”); punkte=db.getInt(“level”); }

somewhere in draw:

if (!db.execute(“INSERT into data (punkte,level) VALUES (punkte, level )”)) println(“error w/sql insert”);

I get an Error:

Error executing sql statement: no such column: punkte (code 1): , while compiling: INSERT into data (punkte,level) VALUES (punkte, level ) error w/sql insert

Any help, please.

27 Jun 2013, 14:10
Generic-user-small

Andreas Knaup (9 posts)

I have some experience with MySQL an PHP, but i do not know what’ wrong with my code.

  You must be logged in to comment