A_I na id spowoduje ?e insert zacznie od 70.
Jak optymalnie to rozwi?za? przy insertach?
Potrzebuje to do systemu pojazd?w, aby przygotowa? ju? sobie pojazdy na danym ID a salony ?eby insertowaly wolne id, oczywi?cie musi to by? zoptymalizowane.
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...