Sqlite Problem.
#3

I don't know at all how to use SQL through SAMP, but I think in SQL this is possible :

PHP код:
    format(Querysizeof(Query), "INSERT INTO `Conturi` (`PlayerIP`,`Nume`,\ 
                                                               `Parola`, `AdminLevel`,\ 
                                                               `Ucideri`,`Decese`,\ 
                                                               `Bani`,`Culoare`,\ 
                                                               `Skin`,`Level`) VALUES('%d','%s','%s','0','0','0','0','0','0','0')"
,GetPlayerIPEx(playerid),DB_Escape(name),DB_Escape(inputtext),0,0,0,0,0,0,0); 
And there's another way to proceed, but this one have to be done when you create your table :

PHP код:
CREATE TABLE IF NOT EXISTS `Conturi` (
            
PlayerIP VARCHAR(16NOT NULL,
            
Nume VARCHAR(25NOT NULL,
            
Parola VARCHAR(60NOT NULL,
            
AdminLevel SMALLINT NOT NULL DEFAULT 0,
            
Ucideri INT NOT NULL DEFAULT 0,
            
Decese INT NOT NULL DEFAULT 0,
            
Bani TINYINT NOT NULL DEFAULT 0,
            
Cloare INT NOT NULL DEFAULT 0,
            
Skin SMALLINT NOT NULL DEFAULT 0,
            
Level TINYINT NOT NULL DEFAULT 0,
            
Primary Key(whatever)
            )
    
ENGINE=INNODB
This way, you can just do (register step)

PHP код:

format
(querysizeof(query), "INSERT INTO Conturi (PlayerIP, Nume, Parola) VALUES ('%s', '%s', '%s')"GetPlayerIPEx(playerid), DB_Escape(name), DB_Escape(inputtext)); 
Oh and btw, it's strongly recommended to HASH (Whirlpool for example) your user passwords BEFORE inserting them in your database. Because once someone else than the user can see as plain text the passwords : they are leaked.
Reply


Messages In This Thread
Sqlite Problem. - by qUneT - 23.06.2014, 12:25
Re: Sqlite Problem. - by qUneT - 23.06.2014, 12:57
Re : Sqlite Problem. - by S4t3K - 23.06.2014, 13:09

Forum Jump:


Users browsing this thread: 1 Guest(s)