Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

sql statement not executed

i have a simple update statement that isn't executed at all. i have no idea what's the matter. got no error.

var db = Ti.Database.open('mydb');
var sql = 'UPDATE db SET imageURL=\"'+url+
            '\" WHERE id='+id;
Ti.API.info(sql);

db.execute(sql);

db.close();

the database is already installed. damn it

— asked October 22nd 2010 by dev 1605
  • sql
  • update
0 Comments

2 Answers

  • Why do you escape the quotes?
    try

    var sql = 'UPDATE db SET imageURL="'+url+ '" WHERE id='+id;
    
    — answered October 22nd 2010 by Dan Tamas
    permalink
    0 Comments
  • hm.. it doesn't execute the statement although i don't escape the quotes. if i execute the statement with an other program like the sqlite database browser it is working fine.

    — answered October 22nd 2010 by dev 1605
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.