Note that there are some explanatory texts on larger screens.

plurals
  1. POFailure 1:Syntax error
    text
    copied!<p>I am a new in SQLite. I am trying to use SQLite in Android. But I am facing this kind of error when I run it.</p> <p>Error:</p> <blockquote> <p>Failure 1 (near "tableuserInfoTable": syntax error) on 0x14d2c8 when preparing <code>'create tableuserInfoTable(_id integer primary key name text not nullemailtext not nullpasswordtext not nulltimetext not null);'</code>.</p> </blockquote> <p>Code:</p> <pre><code>import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; public class DBHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME="data"; public static final int DATABASE_VERSION=1; public static final String USER_TABLE="userTable"; public static final String C_ID="_id"; public static final String USER="name"; public static final String EMAIL="email"; public static final String PASSWORD="password"; public static final String TIME="time"; public final String createDB="create table"+USER_TABLE+"("+C_ID+" integer primary key " +USER+" text not null" +EMAIL+ "text not null" +PASSWORD+ "text not null" +TIME+ "text not null);"; public DBHelper(Context context) { super(context,DATABASE_NAME, null, DATABASE_VERSION); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub db.execSQL(createDB); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub if (newVersion &gt; oldVersion) { Log.w("MyAppTag","Updating database from version " + oldVersion + " to " + newVersion + " .Existing data will be lost."); db.execSQL("drop table if exists"+USER_TABLE); onCreate(db); } } } </code></pre> <p>I went over almost every single example from SO,but I couldn't figure that out. Thank you</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload