Guest User

Untitled

a guest
Sep 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. public void addQuote(String qu_text, int qu_author, int qu_web_id, String qu_time, int qu_like, int qu_share) {
  2. open();
  3. ContentValues v = new ContentValues();
  4. v.put(QU_TEXT, qu_text);
  5. v.put(QU_AUTHOR, qu_author);
  6. v.put(QU_FAVORITE, "0");
  7. v.put(QU_WEB_ID, qu_web_id);
  8. v.put(QU_TIME, qu_time);
  9. v.put(QU_LIKE, qu_like);
  10. v.put(QU_SHARE, qu_share);
  11.  
  12. database.insert(TABLE_QUOTES, null, v);
  13.  
  14. }
  15.  
  16. public void updateQuote(long qu_id, int qu_like, int qu_share) {
  17. open();
  18. ContentValues v = new ContentValues();
  19. v.put(QU_LIKE, qu_like);
  20. v.put(QU_SHARE, qu_share);
  21.  
  22. database.update(TABLE_QUOTES, v, "qu_id=" + qu_id, null);
  23.  
  24. }
  25.  
  26. public void updateRecord(String[] title, long id) {
  27.  
  28. SQLiteDatabase db = this.getWritableDatabase();
  29.  
  30. ContentValues cv = new ContentValues();
  31.  
  32. cv.put(QU_LIKE, title[0]);
  33. cv.put(QU_LIKE,title[1]);
  34.  
  35. db.update(DATABASE_TABLE_NAME, cv, "qu_id" + "=" + id, null);
  36.  
  37. db.close();
  38. }
Add Comment
Please, Sign In to add comment