Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - SQLiteException: near "=": syntax error (code 1)

I am trying to log id from users table and jobname from jobs table using user id

String select = "SELECT jobname FROM " + TABLE_JOBS+ "where userid =" +myid;
like image 303
Sophie Avatar asked Dec 25 '22 12:12

Sophie


1 Answers

"SELECT jobname FROM " + TABLE_JOBS+ "where userid =" +myid;

You need whitespace between identifiers such as your table name and keywords such as where:

"SELECT jobname FROM " + TABLE_JOBS+ " where userid =" +myid;
like image 51
laalto Avatar answered Dec 27 '22 03:12

laalto