Processing Forum
import ketai.data.;
KetaiSQLite db;
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"); }
somewehere in the sketch:
if (!db.execute(“INSERT into data (`punkte`,`level`) VALUES (punkte, level )”)) println(“error w/sql insert”);
I get this error message:
Error executing sql statement: no such column: punkte (code 1): , while compiling: INSERT into data (`punkte`,`level`) VALUES(punkte, level )
error w/sql insert
I have some experience with MySQL and PHP, but i don't know what i'm doing wrong.
http://www.learningprocessing.com/examples/chapter-8/example-8-2/
It creates two objects.
How do i check if the two objects have the same coordinates?