我有SQL数据库的每一件事工作的权利需要正确的SQL语句
NSString *insertSQL = [NSString stringWithFormat: @"INSERT INTO CONTACTS where (modifiedAdress) VALUES (\"%@\")", hemaInsert];
我用这个插入我多么但条件
只有我需要的SQL语句,上述嵌件接触柱modifiedAdress价值hemainsert (condition hemaInsert = ID)
NSString *insertSQL = [NSString stringWithFormat: @"INSERT INTO CONTACTS where (modifiedAdress) VALUES (\"%@\")", hemaInsert];
这是一个非常不好的做法是使用字符串格式创建的SQL语句。如果替换值具有某些字符,则会发生不好的事情。这可能会导致查询失败。这也是许多SQL注入攻击的基础。查看iPatel的答案,将正确的方法绑定到准备好的语句中。 – rmaddy 2013-03-02 17:07:56