not able insert values into sqlite database.
Hi people,
HERE IS MY CODE,
const char *sqlStatement = (const char *)query;
//const char *sqlStatement ="insert into usertable values('one','two')";
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement,NULL) == SQLITE_OK)
{
NSLog(@"inside");
// Loop through the results and add them to the feeds array
while(sqlite3_step(compiledStatement) == SQLITE_ROW)
{ }
sqlite3_finalize(compiledStatement);
}
if i run this code, the values does not get inserted into the database. however if i uncomment the second line and comment the first line it works fine.
the variable "query" is of type NSMutableString and it is a local variable declared in the header file.
sqlStatement is member variable for the method.
i tried several things like retain and release and nothing worked.
not able to resolve this for the past 2 days. and its kindof getting frustrated.
Anyone please HELP???
|