1
tx.executeSql('SELECT * FROM bookmarks WHERE bookmarkID = ?', [newSync[i].id],
  function(tx, results) {
    console.log('results.rows.item(0).bookmarkID', results.rows.item(0).bookmarkID);

    tx.executeSql('UPDATE bookmarksSync SET thumbnail=?, ts_created=?, visits=?,
      visits_morning=?, visits_afternoon=?, visits_evening=?, visits_night=?, position=?,
      idgroup=? WHERE bookmarkID=?', 
      [
        results.rows.item(0).thumbnail, 
        results.rows.item(0).ts_created, 
        results.rows.item(0).visits, 
        results.rows.item(0).visits_morning, 
        results.rows.item(0).visits_afternoon, 
        results.rows.item(0).visits_evening, 
        results.rows.item(0).visits_night, 
        results.rows.item(0).position, 
        0, 
        newSync[i].id
      ], speeddial.storage.onError);
  }, speeddial.storage.onError);

newSync[i].id appears to be undefined and I am pretty sure I have to pass it to the callback function, but I dont know how... Any ideas? I want to be able to pass the newSync[i].id and the results from the SQL selection to another function, which will update the WebSQL table

hydrogen
  • 2,878
  • 21
  • 20
deckoff
  • 341
  • 1
  • 4
  • 16
  • Possible duplicate of: http://stackoverflow.com/q/6129145/330192 and http://stackoverflow.com/q/5024882/330192 – hydrogen Mar 14 '12 at 03:06

0 Answers0