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
 
    