[MYSQL] Syntax error - PLEASE help me... |||
#1

Hallo guys,

I am really need your help! I don't know, why this **** MySQL error comes...
If I register me at my server there no error, but if I wan't to login, I found these error in the serverLOG

Code:
[23:24:48] Error in mysql_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 'Alter=0,Herkunft=0,Spawn=0,Muted=0,Warns=0,Bargeld=500,BkAcc=0,BkGeld=2500,BkNr=' at line 1
[23:24:48] Error in mysql_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 'Int=3,Local=255,Skin=135,TelNr=680254,Hauskey=255,Biskey=255,Carkey1=999,Carkey2' at line 1
[23:24:48] Error in mysql_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 'Alter=0,Herkunft=0,Spawn=0,Muted=0,Warns=0,Bargeld=500,BkAcc=0,BkGeld=2500,BkNr=' at line 1
[23:24:48] Error in mysql_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 'Int=3,Local=255,Skin=135,TelNr=680254,Hauskey=255,Biskey=255,Carkey1=999,Carkey2' at line 1
DEFINES FOR OnPlayerLogin:

Code:
PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pAdmin] = 0;
    PlayerInfo[playerid][pPupgrade] = 0;
    PlayerInfo[playerid][pRespekt] = 0;
    PlayerInfo[playerid][pConnectTime] = 0;
    PlayerInfo[playerid][pReg] = 0;
    PlayerInfo[playerid][pGeschlecht] = 0;
    PlayerInfo[playerid][pAlter] = 0;
    PlayerInfo[playerid][pHerkunft] = 0;
    PlayerInfo[playerid][pSpawn] = 0;
    PlayerInfo[playerid][pMuted] = 0;
    PlayerInfo[playerid][pWarns] = 0;
    PlayerInfo[playerid][pBargeld] = 500;
    PlayerInfo[playerid][pBkAcc] = 0;
    PlayerInfo[playerid][pBkGeld] = 2500;
    PlayerInfo[playerid][pBkNr] = 0;
    PlayerInfo[playerid][pBkName] = 0;
    PlayerInfo[playerid][pCrimes] = 0;
    PlayerInfo[playerid][pKills] = 0;
    PlayerInfo[playerid][pDeaths] = 0;
    PlayerInfo[playerid][pArrested] = 0;
    PlayerInfo[playerid][pKnast] = 0;
    PlayerInfo[playerid][pKnastZeit] = 0;
    PlayerInfo[playerid][pHandy] = 0;
    PlayerInfo[playerid][pTelBuch] = 0;
    PlayerInfo[playerid][pLottoNr] = 0;
    PlayerInfo[playerid][pCDPlayer] = 0;
    PlayerInfo[playerid][pZigaretten] = 0;
    PlayerInfo[playerid][pPayDay] = 0;
    PlayerInfo[playerid][pPayDayAnz] = 0;
    PlayerInfo[playerid][pPayCheck] = 0;
    PlayerInfo[playerid][pJob] = 0;
    PlayerInfo[playerid][pFraktion] = 255;
    PlayerInfo[playerid][pTeam] = 1;
    PlayerInfo[playerid][pLeader] = 0;
    PlayerInfo[playerid][pMember] = 0;
    PlayerInfo[playerid][pRang] = 0;
    PlayerInfo[playerid][pMats] = 0;
    PlayerInfo[playerid][pDrogen] = 0;
    PlayerInfo[playerid][pLeben] = 50.0;
    PlayerInfo[playerid][pSchutz] = 0;
    PlayerInfo[playerid][pInt] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    PlayerInfo[playerid][pSkin] = 135;
    new telnr = 100000 + random(899999);
    PlayerInfo[playerid][pPnummer] = telnr;
    PlayerInfo[playerid][pPhauskey] = 255;
    PlayerInfo[playerid][pPbiskey] = 255;
    PlayerInfo[playerid][pPcarkey1] = 999;
    PlayerInfo[playerid][pPcarkey2] = 999;
    PlayerInfo[playerid][pPos_x] = 1684.9;
    PlayerInfo[playerid][pPos_y] = -2244.5;
    PlayerInfo[playerid][pPos_z] = 13.5;
    PlayerInfo[playerid][pCarLiz] = 0;
    PlayerInfo[playerid][pFlugLiz] = 0;
    PlayerInfo[playerid][pBootLiz] = 0;
    PlayerInfo[playerid][pWaffenLiz] = 0;
    PlayerInfo[playerid][pGun1] = 0;
    PlayerInfo[playerid][pGun2] = 0;
    PlayerInfo[playerid][pGun3] = 0;
    PlayerInfo[playerid][pAmmo1] = 0;
    PlayerInfo[playerid][pAmmo2] = 0;
    PlayerInfo[playerid][pAmmo3] = 0;
    PlayerInfo[playerid][pMarried] = 0;
    PlayerInfo[playerid][pTut] = 0;
    PlayerInfo[playerid][pLearn] = 0;
    PlayerInfo[playerid][pLocked] = 0;
    PlayerInfo[playerid][pLinked] = 0;
I don't know what to do, but my OnPlayerLogin function isn't defect!

Code:
public OnPlayerLogin(playerid,password[])
{
	MySQLCheckConnection();
	new tmp2[256];
	new playername2[MAX_PLAYER_NAME];
	new playernamesplit[3][MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
	split(playername2, playernamesplit, '_');
	MySQLFetchAcctSingle(PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]);
	if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
	{
		new Data[1024];
		new Field[64];
		new rcnt = 1;
		MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
		samp_mysql_strtok(Field, "|", Data);
		while (samp_mysql_strtok(Field, "|", "") == 1)
		{
            if (rcnt == 3) PlayerInfo[playerid][pLevel] = strval(Field);
            if (rcnt == 4) PlayerInfo[playerid][pAdmin] = strval(Field);
            if (rcnt == 5) PlayerInfo[playerid][pPupgrade] = strval(Field);
            if (rcnt == 6) PlayerInfo[playerid][pRespekt] = strval(Field);
            if (rcnt == 7) PlayerInfo[playerid][pConnectTime] = strval(Field);
            if (rcnt == 8) PlayerInfo[playerid][pReg] = strval(Field);
            if (rcnt == 9) PlayerInfo[playerid][pGeschlecht] = strval(Field);
            if (rcnt == 10) PlayerInfo[playerid][pAlter] = strval(Field);
            if (rcnt == 11) PlayerInfo[playerid][pHerkunft] = strval(Field);
            if (rcnt == 12) PlayerInfo[playerid][pSpawn] = strval(Field);
            if (rcnt == 13) PlayerInfo[playerid][pMuted] = strval(Field);
            if (rcnt == 14) PlayerInfo[playerid][pWarns] = strval(Field);
            if (rcnt == 15) PlayerInfo[playerid][pBargeld] = strval(Field);
            if (rcnt == 16) PlayerInfo[playerid][pBkAcc] = strval(Field);
            if (rcnt == 17) PlayerInfo[playerid][pBkGeld] = strval(Field);
            if (rcnt == 18) PlayerInfo[playerid][pBkNr] = strval(Field);
            if (rcnt == 19) PlayerInfo[playerid][pBkName] = strval(Field);
            if (rcnt == 20) PlayerInfo[playerid][pCrimes] = strval(Field);
            if (rcnt == 21) PlayerInfo[playerid][pKills] = strval(Field);
            if (rcnt == 22) PlayerInfo[playerid][pDeaths] = strval(Field);
            if (rcnt == 23) PlayerInfo[playerid][pArrested] = strval(Field);
            if (rcnt == 24) PlayerInfo[playerid][pKnast] = strval(Field);
            if (rcnt == 25) PlayerInfo[playerid][pKnastZeit] = strval(Field);
            if (rcnt == 26) PlayerInfo[playerid][pHandy] = strval(Field);
            if (rcnt == 27) PlayerInfo[playerid][pTelBuch] = strval(Field);
            if (rcnt == 28) PlayerInfo[playerid][pLottoNr] = strval(Field);
            if (rcnt == 29) PlayerInfo[playerid][pCDPlayer] = strval(Field);
            if (rcnt == 30) PlayerInfo[playerid][pZigaretten] = strval(Field);
            if (rcnt == 31) PlayerInfo[playerid][pPayDay] = strval(Field);
            if (rcnt == 32) PlayerInfo[playerid][pPayDayAnz] = strval(Field);
            if (rcnt == 33) PlayerInfo[playerid][pPayCheck] = strval(Field);
            if (rcnt == 34) PlayerInfo[playerid][pJob] = strval(Field);
            if (rcnt == 35) PlayerInfo[playerid][pFraktion] = strval(Field);
            if (rcnt == 36) PlayerInfo[playerid][pTeam] = strval(Field);
            if (rcnt == 37) PlayerInfo[playerid][pLeader] = strval(Field);
            if (rcnt == 38) PlayerInfo[playerid][pMember] = strval(Field);
            if (rcnt == 39) PlayerInfo[playerid][pRang] = strval(Field);
            if (rcnt == 40) PlayerInfo[playerid][pMats] = strval(Field);
            if (rcnt == 41) PlayerInfo[playerid][pDrogen] = strval(Field);
            if (rcnt == 42) PlayerInfo[playerid][pLeben] = floatstr(Field);
            if (rcnt == 43) PlayerInfo[playerid][pSchutz] = floatstr(Field);
            if (rcnt == 44) PlayerInfo[playerid][pInt] = strval(Field);
            if (rcnt == 45) PlayerInfo[playerid][pLocal] = strval(Field);
            if (rcnt == 46) PlayerInfo[playerid][pSkin] = strval(Field);
            if (rcnt == 47) PlayerInfo[playerid][pPnummer] = strval(Field);
            if (rcnt == 48) PlayerInfo[playerid][pPhauskey] = strval(Field);
            if (rcnt == 49) PlayerInfo[playerid][pPbiskey] = strval(Field);
            if (rcnt == 50) PlayerInfo[playerid][pPcarkey1] = strval(Field);
            if (rcnt == 51) PlayerInfo[playerid][pPcarkey2] = strval(Field);
            if (rcnt == 52) PlayerInfo[playerid][pPos_x] = floatstr(Field);
            if (rcnt == 53) PlayerInfo[playerid][pPos_y] = floatstr(Field);
            if (rcnt == 54) PlayerInfo[playerid][pPos_z] = floatstr(Field);
            if (rcnt == 55) PlayerInfo[playerid][pCarLiz] = strval(Field);
            if (rcnt == 56) PlayerInfo[playerid][pFlugLiz] = strval(Field);
            if (rcnt == 57) PlayerInfo[playerid][pBootLiz] = strval(Field);
            if (rcnt == 58) PlayerInfo[playerid][pWaffenLiz] = strval(Field);
            if (rcnt == 59) PlayerInfo[playerid][pGun1] = strval(Field);
            if (rcnt == 60) PlayerInfo[playerid][pGun2] = strval(Field);
            if (rcnt == 61) PlayerInfo[playerid][pGun3] = strval(Field);
            if (rcnt == 62) PlayerInfo[playerid][pAmmo1] = strval(Field);
            if (rcnt == 63) PlayerInfo[playerid][pAmmo2] = strval(Field);
            if (rcnt == 64) PlayerInfo[playerid][pAmmo3] = strval(Field);
            if (rcnt == 65) PlayerInfo[playerid][pMarried] = strval(Field);
            if (rcnt == 66) PlayerInfo[playerid][pMarriedTo] = strmid(PlayerInfo[playerid][pMarriedTo], Field, 0, strlen(Field)-1, 255);
            if (rcnt == 67) PlayerInfo[playerid][pTut] = strval(Field);
            if (rcnt == 68) PlayerInfo[playerid][pLearn] = strval(Field);
            if (rcnt == 69) PlayerInfo[playerid][pLocked] = strval(Field);
            if (rcnt == 70) PlayerInfo[playerid][pLinked] = strval(Field);
            rcnt++;
		}
		samp_mysql_free_result();
	} else {
		format(dstring, sizeof(dstring), "\n%s, Du hast Dein Passwort falsch eingegeben!\n\nLoginversuch(e) ьbrig: %d\n ", playername2, (2 - gPlayerLogTries[playerid]));
 		ShowPlayerDialog(playerid,0002,DIALOG_STYLE_INPUT,"4#Future - Serverlogin",dstring,"Einloggen","Abbrechen");
  		gPlayerLogTries[playerid] += 1;
	}
	if(gPlayerLogTries[playerid] == 3)
	{
		format(dstring, sizeof(dstring), "\n%s, Du hast Dein Passwort 3x falsch eingegeben.\nAufgrund dieser Tatsache wurdest Du soeben gebannt!\n\nSollte dies nicht gerechtfertigt sein, wende dich bitte an einem Admin.\n ", playername2);
		ShowPlayerDialog(playerid,0060,DIALOG_STYLE_MSGBOX,"4#Future - Serverlogin fehlgeschlagen (Bann)", dstring, "OK", "");
		Ban(playerid);
	}

	SafeResetPlayerMoney(playerid);
	SafeGivePlayerMoney(playerid, PlayerInfo[playerid][pBargeld]);

	if(PlayerInfo[playerid][pReg] == 0)
	{
		PlayerInfo[playerid][pLevel] = 1;
		PlayerInfo[playerid][pLeben] = 50.0;
		PlayerInfo[playerid][pSchutz] = 0.0;
		PlayerInfo[playerid][pPos_x] = 2246.6;
		PlayerInfo[playerid][pPos_y] = -1161.9;
		PlayerInfo[playerid][pPos_z] = 1029.7;
		PlayerInfo[playerid][pInt] = 15;
		PlayerInfo[playerid][pLocal] = 255;
		PlayerInfo[playerid][pTeam] = 1;
		PlayerInfo[playerid][pSkin] = 135;
		new randphone = 100000 + random(899999);
		PlayerInfo[playerid][pPnummer] = randphone;
		PlayerInfo[playerid][pPhauskey] = 255;
		PlayerInfo[playerid][pPbiskey] = 255;
		PlayerInfo[playerid][pPcarkey1] = 999;
		PlayerInfo[playerid][pPcarkey2] = 999;
		PlayerInfo[playerid][pReg] = 1;
	}

	if(PlayerInfo[playerid][pLevel] == -999)
	{
		Ban(playerid);
	}

	new ipaddress[16];
	GetPlayerIp(playerid, ipaddress, sizeof(ipaddress));
	MySQLAddLoginRecord(PlayerInfo[playerid][pSQLID], ipaddress);

	format(dstring, sizeof(dstring), "\nAh, hallo %s und willkommen zurьck!\n\nSchцn das Du wieder da bist!\nWir wьnschen Dir viel Freude auf unserem Server.\nBitte beachte die Serverregeln und benehme dich Reallife gerecht.\nBesuch uns doch mal unter: www.4future.tk\n ", playername2);
    ShowPlayerDialog(playerid, 0040, DIALOG_STYLE_MSGBOX, "Herzlich Willkommen bei 4#Future...", dstring, "OK", "");

    if(PlayerInfo[playerid][pAdmin] > 0)
	{
	  	format(dstring, sizeof(dstring), "\nAh, hallo %s und willkommen zurьck!\n\nSchцn das Du wieder da bist!\nWir wьnschen Dir viel Freude auf unserem Server.\nBitte beachte die Serverregeln und benehme dich Reallife gerecht.\nBesuch uns doch mal unter: www.4future.tk\n\nDu bist als Level %d Admin eingeloggt.\n ",playername2, PlayerInfo[playerid][pAdmin]);
	    ShowPlayerDialog(playerid, 0041, DIALOG_STYLE_MSGBOX, "Herzlich Willkommen bei 4#Future...", dstring, "OK", "");
	}

	SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);

	format(tmp2, sizeof(tmp2), "~w~Willkommen ~n~~r~   %s", playername2);
	GameTextForPlayer(playerid, tmp2, 5000, 1);

	gPlayerLogged[playerid] = 1;
	SpawnPlayer(playerid);
	
	// -- Log --
	new plname[50];
	new logstr[256];
	gettime(gHour, gMinute);
    getdate(gYear, gMonth, gDay);
    GetPlayerName(playerid, plname, sizeof(plname));
	format(logstr, sizeof(logstr), "[%02d.%02d.%d - %02d:%02d] %s hat sich eingeloggt.", gDay, gMonth, gYear, gHour, gMinute, plname);
	LoginLog(logstr);
	return 1;
}
Really I need a good Scripter, who can helps me or connects to my
computer with TeamViewer...


Thanks for help!
Reply
#2

Is there anyone who can help me please?

It's reallly important for me... please
Reply
#3

Don't try to put MySQL in GF/PEN it won't work, it already take loads of memory and with MySQL it just woudn't hold it.
Reply
#4

The error says your sql query is wrong. Check it again for any typos
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)