Making sure an 'int' is bound on sqlite

Posted by iphone_developer on Stack Overflow See other posts from Stack Overflow or by iphone_developer
Published on 2009-10-07T00:42:52Z Indexed on 2010/05/22 6:00 UTC
Read the original article Hit count: 132

Filed under:
|

I have a method called like this...

-(void)dbUpdate:(int)forId {

Which contains this sqlite to bind and update a database.

sqlite3_bind_int(UPDATE_ACCOUNT, 3, forId);

When I run the query, it doesn't give me an error, but it doesn't update the database either.

If I change this line of code...

sqlite3_bind_int(UPDATE_ACCOUNT, 3, forId);

manually, to...

sqlite3_bind_int(UPDATE_ACCOUNT, 3, 6);

the query runs 100% fine, as expected.

Changing the variable to an actual integer proves to me that the variable 'forId' isn't being passed or bound to the query properly.

What am I doing wrong? How is the best way to pass an Integer (and make sure it is an Integer) into an sqlite bind?

Cheers,

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk