網上找到http://blog.csdn.net/heihuifeng/article/details/6561615這篇文章 ,插入的字元串需加引号‘,
[_db
executeupdate:[nsstring
stringwithformat:@"insert into %@ (name,img,date,iscome,msg_type,message,isnew,sendflag,personid) values(‘%@‘,‘%@‘,‘%@‘,‘%@‘,‘%@‘,‘%@‘,‘%@‘,‘%@‘,‘%@‘)",userid,frienddata.m_name,frienddata.m_imgurl,data.sendtime,@"1",data.texttype,data.chatfilemodeljson,@"1",@"3",data.entuserid]];
由于之前沒有加引号。