このクエリを使用して画像を含むデータを保存したいのですが、すべてが正しく更新されますが、画像列は常に null です。このクエリの何が問題なのかわかりません。誰か助けてください。iOS が初めてで、 sqliteも。
UIImage *uiimg = img.image;
NSData *data = UIImagePNGRepresentation(uiimg);
NSString *cmd = [NSString stringWithFormat:@"update APPUSERS set name = '%@', u_name = '%@', contact_no = '%@', address = '%@', dob = '%@', pswrd = '%@', confirm_pswrd = '%@', img = '%d' where u_name ='%@'",name.text, uname.text, pnoneno.text, address.text, dob.text, password.text, confirmpassword.text, data, tempstore] ;
const char * sql = [cmd UTF8String];
if (sqlite3_step(update_statement) == SQLITE_DONE)
{
NSLog(@"success");
}
else
{
NSLog(@"failed");
}