sqlite problem
#1

Hello, I'm making a record in sqlite, I connect to the server all good, when reviewing the db to see if I insert data there is nothing

pawn Код:
stock ReturnPlayerName(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    return pname;
}
#define GetPlayerName(%0)   ReturnPlayerName(%0)



new
        Query[ 256 ], // Creating a big array this time. No lies :X
    plrIP[ 16 ], // Create a IP string
        buf[129]
    ;

//THIS IS A DIALOG
WP_Hash(buf, 129, inputtext);
format(Query, sizeof(Query), "INSERT INTO `Users` (`Username`, `Password`, `IP`, ) VALUES('%s', '%s', '%s')", DB_Escape(GetPlayerName(playerid)), DB_Escape(buf), DB_Escape(plrIP));
db_query(Database, Query);
Reply
#2

try this:
pawn Код:
WP_Hash(buf, 129, inputtext);
format(Query, sizeof(Query), "INSERT INTO `Users` (`Username`, `Password`, `IP`) VALUES('%s', '%s', '%s')", DB_Escape(GetPlayerName(playerid)), DB_Escape(buf), DB_Escape(plrIP));
db_query(Database, Query);
Reply
#3

same bro, nothing S:
Reply
#4

Get SQLitei and enable error checking.
https://sampforum.blast.hk/showthread.php?tid=303682

Requires AMX assembly library
https://github.com/Zeex/amx_assembly

Put this into your gamemode

pawn Код:
#define DB_QUERY_ERRORS true
#include <sqlitei>
I almost forgot to mention error checking only works in Windows.
Reply
#5

The query works fine if executed in sqlite

INSERT INTO `Users` (`Username`, `Password`, `IP`) VALUES('0', '0', '0')
Reply
#6

Like I said dude, use the error checking.
Reply
#7

bro, fatal error 111: user error: amx_assembly is required for DB_QUERY_ERRORS. Get it here: github.com/zeex/amx_assembly

i download this and put on include file
Reply
#8

It should be in your common includes a_samp etc like this

include\amx_assembly
Reply
#9

bro, my gm http://pastebin.com/Jkh7Ut56
Reply
#10

small bump!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)