Writing to SQLite inside loop
#1

hi guys got a wee bit of an issue. I'm not fantastically familliar with SQLite in pawn and This kinda works but not really...

pawn Код:
new Query[256];
    for(new varID=1;varID<=2001;varID++) {
        format(Query,sizeof(Query), "INSERT INTO `VEHICLES` (`LINEIDENT`,`VALID`, `INFO`) VALUES('%d', '0','invalid')", varID);
        db_query(Database, Query);
    }
basically on inspection the GM hangs up at 56 ID's written to the database then it just stops dead.

What I don't need is a diatribe on why i should use MySQL etc and anyone that does that gets negative rep...

The only thing i would like any advice on is why it's hanging - I'm going to assume it's due to me doing this inside a loop. Anyone with superior knowledge on the issue of SQLite please feel free to make suggestions or comments.

before anyone asks I've gone through multiple tutorials and I think my query string is formatted correctly - I've also looked through a number of tutorials on SQLite and can't really see an issue.

Any helpful comments are much appreciated, Thanks Guys!
Reply


Messages In This Thread
Writing to SQLite inside loop - by CJay9209 - 15.04.2013, 01:10
Re: Writing to SQLite inside loop - by T101 - 15.04.2013, 01:26
Re: Writing to SQLite inside loop - by DaTa[X] - 15.04.2013, 01:37
Re: Writing to SQLite inside loop - by CJay9209 - 15.04.2013, 02:01
Re: Writing to SQLite inside loop - by [ABK]Antonio - 15.04.2013, 03:17
Re: Writing to SQLite inside loop - by CJay9209 - 15.04.2013, 03:40

Forum Jump:


Users browsing this thread: 1 Guest(s)