Oko MySQL

Započeo .ysi, Februar 21, 2022, 20:04:27 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Problem(error/warning): Prvi put se susrecem sa MySQL...znc pravioo sam login register sys i sve radi ovako in game ali nece login da pojasnim kada prvi put udjem na srw pise register kada drugi put udjem pise opet register nece nikako login...
Deo skripte: [pawn]Ostavljam cijelu skriptu: https://pastebin.com/v3Sh6SAy[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [pawn]Evo errori iz logs / errors
[pawn]
[19:51:41] [plugins/mysql] error #1054 while executing query "INSERT INTO `users` (`Username`, `Password`, `Score`, `Kills`, `Cash`, `Deaths`)VALUES ('Joz', '5E4B1B691E8E464E5C9D219D5499C66C77C74D4E185492B78233A66119D28EDB','0', '0', '0', '0')": Unknown column 'Kills' in 'field list'
[19:51:51] [plugins/mysql] error #1054 while executing query "UPDATE `users` SET `Score` = 0, `Cash` = 0, `Kills` = 0, `Deaths` = 0 WHERE `ID` = 0 LIMIT 1": Unknown column 'Cash' in 'field list'
[19:52:20] [plugins/mysql] error #1054 while executing query "INSERT INTO `users` (`Username`, `Password`, `Score`, `Kills`, `Cash`, `Deaths`)VALUES ('Joz', '5E4B1B691E8E464E5C9D219D5499C66C77C74D4E185492B78233A66119D28EDB','0', '0', '0', '0')": Unknown column 'Kills' in 'field list'
[19:52:24] [plugins/mysql] error #1054 while executing query "UPDATE `users` SET `Score` = 0, `Cash` = 0, `Kills` = 0, `Deaths` = 0 WHERE `ID` = 0 LIMIT 1": Unknown column 'Cash' in 'field list'
[19:52:50] [plugins/mysql] error #1054 while executing query "INSERT INTO `users` (`Username`, `Password`, `Score`, `Kills`, `Cash`, `Deaths`)VALUES ('Joz', '5E4B1B691E8E464E5C9D219D5499C66C77C74D4E185492B78233A66119D28EDB','0', '0', '0', '0')": Unknown column 'Kills' in 'field list'
[19:53:06] [plugins/mysql] error #1054 while executing query "UPDATE `users` SET `Score` = 0, `Cash` = 0, `Kills` = 0, `Deaths` = 0 WHERE `ID` = 0 LIMIT 1": Unknown column 'Cash' in 'field list'

[/pawn][/pawn]
Slika/video ingame problema(obavezno ako je ingame problem): //
Poslednja Izmena: Februar 24, 2022, 14:31:16 POSLE PODNE od 'xza
e

Pa naucite vise da citate sta pise...Razumem da ti kaze neki nepoznat error koji se moze tumaciti na vise nacina ali kad ti lepo kaze...

Cash nemas u tabeli...

[pawn] Unknown column 'Kills' in 'field list'
Unknown column 'Cash' in 'field list'[/pawn]

Citat: Deleted User poslato Februar 21, 2022, 20:07:01 POSLE PODNE
Pa naucite vise da citate sta pise...Razumem da ti kaze neki nepoznat error koji se moze tumaciti na vise nacina ali kad ti lepo kaze...

Cash nemas u tabeli...
Kojoj tabeli ? Gdje trebam dodati ?
e


Citat: 'xza poslato Februar 21, 2022, 20:32:48 POSLE PODNE
users
ja users vidim samo
[pawn]
public OnPlayerConnect(playerid) {
   GameTextForPlayer(playerid, "~p~Ucitavanje servera,molimo sacekajte", 5, 6);
   new DB_Query[115];
   GetPlayerName(playerid, PI[playerid][Name], MAX_PLAYER_NAME);
   mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `users` WHERE `Username` = '%e' LIMIT 1", PI[playerid][Name]);
   mysql_tquery(Database, DB_Query, "OnPlayerDataCheck", "i", playerid);
   //++
   PogresnaLozinka[playerid] = 0;
   return (true);
}
[/pawn]
[pawn]
else {
            new DB_Query[256];
            SHA256_PassHash(inputtext, GetName(playerid), PI[playerid][Password], 65);
             mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `users` (`Username`, `Password`, `Score`, `Kills`, `Cash`, `Deaths`)\
             VALUES ('%e', '%s','0', '0', '0', '0')", PI[playerid][Name], PI[playerid][Password]);
             mysql_tquery(Database, DB_Query);
             SetSpawnInfo(playerid, 0, 26, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
             SpawnPlayer(playerid);
             SetPlayerScore(playerid, PI[playerid][Score]);
             GivePlayerMoney(playerid, PI[playerid][Cash]);
         }
[pawn]
mysql_format(Database, DB_Query, sizeof(DB_Query),"SELECT * FROM `users` WHERE `Username` = '%e' LIMIT 1", PI[playerid][Name]);
             mysql_tquery(Database, DB_Query, "LoadAcc", "i", playerid);
             //++
             SetPlayerScore(playerid, PI[playerid][Score]);
             GivePlayerMoney(playerid, PI[playerid][Cash]);
             SetSpawnInfo(playerid, 0,26,1328.1277,-1558.4608,13.5469, 139.9262, 0,0,0,0,0,0);
            SpawnPlayer(playerid);
[/pawn]
[pawn]
stock SavePlayer(playerid) {
   new DB_Query[256];
   mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `users` SET `Score` = %d, `Cash` = %d, `Kills` = %d, `Deaths` = %d WHERE `ID` = %d LIMIT 1",
   PI[playerid][Score], PI[playerid][Cash], PI[playerid][Kills], PI[playerid][Deaths], PI[playerid][ID]);
   mysql_tquery(Database, DB_Query);
   return (true);
}
[/pawn]
e

U mysql tabeli na phpmyadmin moras da dodas red Cash i Kills

Citat: V01D poslato Februar 21, 2022, 21:42:07 POSLE PODNE
U mysql tabeli na phpmyadmin moras da dodas red Cash i Kills
A kako dodati evo trazim pola sata opciju i nmg naci...?
e

u bazi dodaj pa importuj bazu

Citat: Sync poslato Februar 21, 2022, 22:40:13 POSLE PODNE
A kako dodati evo trazim pola sata opciju i nmg naci...?
Pa kako si onda kreirao Password, Username i ostalo ?

trebas prvo napraviti bazu za mysql u phpmyadminu i kad si napravio bazu u users dodas cash kill i sta vec sve trebas