[SQLite Help] Insert Into doesn't work? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [SQLite Help] Insert Into doesn't work? (
/showthread.php?tid=533917)
[SQLite Help] Insert Into doesn't work? -
Tika Spic - 27.08.2014
I started making a SQLite based mode and everything was going great until i came to the point of registration :P
I made the database (baza) and all the other 'query commands' (if it's not how they are called forgive me..) like select, create work except for insert into.. I mean i don't see a mistake and I've checked tutorials that work fine like this but it just won't create a row in the DB
At first I thought there were too many enteries at once (around 15 I guess) so I set it just for name and password but it still doesn't work..
Then I thought my dq string size was too small so I set it to 500 to test and it still doesn't work..
Код:
format(dq,sizeof(dq),"INSERT INTO `users` (`name`, `pass`) VALUES('%s', %s')",dbescape(name),dbescape(password));
db_query(baza,dq);
I've renamed DB_Escape to dbescape for typing reasons ...
Thanks in advance
Re: [SQLite Help] Insert Into doesn't work? -
Keyhead - 27.08.2014
pawn Код:
format(dq,sizeof(dq),"INSERT INTO `users` (`name`, `pass`) VALUES('%s', %s')",dbescape(name),dbescape(password));
db_query(baza,dq);
You're missing an ` on the second %s in VALUES.
Re: [SQLite Help] Insert Into doesn't work? -
Tika Spic - 27.08.2014
And here I thought I wasn't an idiot..
Thanks man!