Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: into
1. INSERT INTO

exports
.sql:query_insertid("INSERT INTO `mascotas` (`ID`, `raza`, `name`, `owner`, `x`, `y`, `z`, `interior`, `dimension`) VALUES (NULL, '0', 'Bitka', ''"..exports.players:getCharacterIDsource ).."'', '0', '0','0','0','0' ")

cze?? po raz pierwszy chc? si? nauczy? dodawa? wiersze z poziomu lua, m?gby ktos mi to wyt?umaczy? czemu nie dodaje wiersza o warto?ciach samych 0?



[ Dodano: 2022-06-17, 15:15 ]
ok mo?na zamkn?? stworzy?am, r?cznie p??niej te warto?ci wprowadzi?am w lua i dodaje
2. Insert Into mysql
Cze??.

Podczas pr?by wpisania konta do tabeli w MySQL wyskakuje error:
Kod:


Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('nick', 'haslo', 'salt', 'money', 'bank', 'gamescore', 'premiumlvl', 'adminlvl'' at line 1.


Kod zapytania:
Kod:

INSERT INTO samp_players SET (nick, haslo, salt, money, bank, gamescore, premiumlvl, adminlvl, hp, armor, posx, posy, posz, interior, virtualworld, ipreg, iplast, probylog, wiek, pochodzenie, skin, plec, frakcja, family, skinf) VALUES ('%s', '%s', '%s', '100', '0', '0', '0', '0', '75.0', '0.0', '0.0', '0.0', '0.0', '0', '0', '%s', '%s', '0', '0', '0', '0', '0', '0', '0')
3. INSERT INTO konta do bazy danych
mam problem z rejestracj? gracza poniewa? mam taki o to kod:



[code]
if(dialogid == REJESTRUJ)
{
if(response == 0)
{
SendClientMessage(playerid, COLOR_RED, "Anulowales/as rejestracje, zostaniesz wyrzucony z serwera!");
Kick(playerid);
}
if(response == 1)
{
if(strlen(inputtext) == 0)
{
ShowPlayerDialog(playerid, REJESTRUJ, DIALOG_STYLE_PASSWORD, "Rejestracja - RealLife", "Nie wpisales nowego hasla, wpisz swoje nowe haslo: ", "Zarejestruj", "Anuluj");
}
else
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
new EscapedText[60];
new str[128];
mysql_real_escape_string(inputtext, EscapedText);
format(str,sizeof(str),"INSERT INTO `members` (`name`,`haslo`,`cash`,`health`,`armor`,`skin`,`posX`,`posY`,`posZ`) VALUES ('%s','%s,1100,100.0,0.0,25,10.0,10.0,10.0)",name,EscapedText);
mysql_query(str);

printf(str);



}
}
} [/code]

Gdy wchodz? na serwer, wpisuje has?o, w konsoli pokazuje si? error:

[code]
[00:35:50] [join] Noorsik has joined the server (0:127.0.0.1)
[00:35:52] [MySQL] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1234,1100,100.0,0' at line 1.
[00:35:52] INSERT INTO `members` (`name`,`haslo`,`cash`,`health`,`armor`,`skin`,`po...