简体   繁体   中英

Adding variable to a sql statement isn't working

我想在 sql (android) 中向我的表中添加变量,但这不起作用

articlesDatabase.execSQL("INSERT INTO articles VALUES(" + theId + "," + title + "," + url +  ")");

这就是它的工作方式

articlesDatabase.execSQL("INSERT INTO articles Values (" + theId + ", '" + title + "', '" + url + "');");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM