MYSQL - Mod

Započeo noddy_, Oktobar 23, 2021, 09:37:24 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Nista od navedenog, vec kada napravim novi racun u sampu i registrujem se u DB se ne kreira korisnicki racun
Deo skripte: [pawn]new query[500];
         mysql_format(SQL, query,sizeof(query),"INSERT INTO `players` (`Username`,`Password`,`Skin`,`Level`, `Respekt`, `NeededRep`,`Novac`, `Posao`) \
            VALUES ('%e','%d','60','2','0','0','50000', '0')",
            GetName(playerid),
            IgracInfo[playerid][Password]);
         mysql_tquery(SQL,query,"IgracRegistrovan", "i",playerid);[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ERROR] error #1062 while executing query "INSERT INTO `players` (`Username`,`Password`,`Skin`,`Level`, `Respekt`, `NeededRep`,`Novac`, `Posao`) VALUES ('Dino_Mehmed','458163342','60','2','0','0','50000', '0')": Duplicate entry '0' for key 'PRIMARY' (C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Treasure RP\gamemodes\TR.pwn:381)
Poslednja Izmena: Oktobar 25, 2021, 22:23:40 POSLE PODNE od M Ө M Σ N Z I
SPEED HACK (C++) https://github.com/nouddy/samp-speed-hack
Reliant GameMode (open.mp) https://github.com/nouddy/reliant-omp
SA:MP Landing Page https://github.com/nouddy/samp-landing-page


Kolko drama ima u 7 grama

[pawn]Duplicate entry '0' for key 'PRIMARY'[/pawn]

Citat: ʟᴀᴋᴇʀɪɴɢ poslato Oktobar 23, 2021, 13:14:18 POSLE PODNE
[pawn]Duplicate entry '0' for key 'PRIMARY'[/pawn]
Nema sta nisam uradio, opet nece
SPEED HACK (C++) https://github.com/nouddy/samp-speed-hack
Reliant GameMode (open.mp) https://github.com/nouddy/reliant-omp
SA:MP Landing Page https://github.com/nouddy/samp-landing-page


Kolko drama ima u 7 grama

Daj sliku baze ali samo columns prikazi, kod tabele players imas + stisnes na njega i pise ti columns to uslikaj

"They have computers, and they may have other weapons of mass destruction."


Evo ti slika https://prnt.sc/1x6gbas

Stisni na to columns i to mi uslikaj

"They have computers, and they may have other weapons of mass destruction."


Primary key ti je postavljen na ID, a primary key ne smije biti isti jer se po njemu razilikuje svaki red.

Tako da moraš ili manuelno dodavati svaki put novi broj u ID ili (jednostavnije) napravis Auto Increment u tabeli.

Za autoincrement stistni na to columns i Edit na ID i imas Auto Increment, negdje ti stoji i A_I

"They have computers, and they may have other weapons of mass destruction."