02.03.2012, 22:21
Errors with my MySQL, copied from a tutorial so I don't have a clue about it, I only know how to use saving/loading though Y_INI and similar things. (Converting script from Y_INI to MySQL, nearly done except for these)
(2120) : error 075: input line too long (after substitutions)
(2121) : error 037: invalid string (possibly non-terminated string)
(2121) : error 017: undefined symbol "SELECT"
(2121) : error 017: undefined symbol "cash"
(2121) : fatal error 107: too many error messages on one line
(2120) : error 075: input line too long (after substitutions)
(2121) : error 037: invalid string (possibly non-terminated string)
(2121) : error 017: undefined symbol "SELECT"
(2121) : error 017: undefined symbol "cash"
(2121) : fatal error 107: too many error messages on one line
pawn Код:
stock MySQL_Login(playerid)
{
new query[5426], pname[24], savingstring[6425];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT cash, deposit, payday, paycheck, connecttime, age, sex, level, number, phonebook, job, skin, team, accent, admin, spectate, banned, muted, reportmuted, \
experiance, vip, vipmuted, jailed, jailtime, toggedvipchat, housekey, warns, posx, posy, posz, posa, health, armor, materials, cocaine, packages, interior, virtualworld, dice, \ //(2120) : error 075: input line too long (after substitutions)
weapon1, weapon1a, weapon2, weapon2a, weapon3, weapon3a, weapon4, weapon4a, weapon5, weapon5a, weapon6, weapon6a, weapon7, weapon7a, weapon8, weapon8a, weapon9, weapon9a, weapon10, \ //(2121) : error 037: invalid string (possibly non-terminated string)...
weapon10a, weapon11, weapon11a, weapon12, weapon12a, killlog0, killlog1, killlog2, killlog3, killlog4, killlog5, killlog6, killlog7, killlog8, killlog9, deaths, faction, rank, leader, \
duty, crimes, wantedlevel, radio, radiofreq, spam, dashboard FROM playerdata WHERE user = '%s'", pname);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(savingstring, "cash"); PlayerInfo[playerid][pCash] = strval(savingstring);
mysql_fetch_field_row(savingstring, "deposit"); PlayerInfo[playerid][pDeposit] = strval(savingstring);
mysql_fetch_field_row(savingstring, "payday"); PlayerInfo[playerid][pPayDay] = strval(savingstring);
mysql_fetch_field_row(savingstring, "paycheck"); PlayerInfo[playerid][pPayCheck] = strval(savingstring);
mysql_fetch_field_row(savingstring, "connecttime"); PlayerInfo[playerid][pConnectTime] = strval(savingstring);
mysql_fetch_field_row(savingstring, "age"); PlayerInfo[playerid][pAge] = strval(savingstring);
mysql_fetch_field_row(savingstring, "sex"); PlayerInfo[playerid][pSex] = strval(savingstring);
mysql_fetch_field_row(savingstring, "level"); PlayerInfo[playerid][pLevel] = strval(savingstring);
mysql_fetch_field_row(savingstring, "number"); PlayerInfo[playerid][pNumber] = strval(savingstring);
mysql_fetch_field_row(savingstring, "phonebook"); PlayerInfo[playerid][pPB] = strval(savingstring);
mysql_fetch_field_row(savingstring, "job"); PlayerInfo[playerid][pJobID] = strval(savingstring);
mysql_fetch_field_row(savingstring, "skin"); PlayerInfo[playerid][pSkin] = strval(savingstring);
mysql_fetch_field_row(savingstring, "team"); PlayerInfo[playerid][pTeam] = strval(savingstring);
mysql_fetch_field_row(savingstring, "accent"); PlayerInfo[playerid][pAccent] = strval(savingstring);
mysql_fetch_field_row(savingstring, "admin"); PlayerInfo[playerid][pAdmin] = strval(savingstring);
mysql_fetch_field_row(savingstring, "spectate"); PlayerInfo[playerid][pSpectate] = strval(savingstring);
mysql_fetch_field_row(savingstring, "banned"); PlayerInfo[playerid][pBanned] = strval(savingstring);
mysql_fetch_field_row(savingstring, "muted"); PlayerInfo[playerid][pMuted] = strval(savingstring);
mysql_fetch_field_row(savingstring, "reportmuted"); PlayerInfo[playerid][pReportMuted] = strval(savingstring);
mysql_fetch_field_row(savingstring, "experiance"); PlayerInfo[playerid][pExp] = strval(savingstring);
mysql_fetch_field_row(savingstring, "vip"); PlayerInfo[playerid][pVip] = strval(savingstring);
mysql_fetch_field_row(savingstring, "vipmuted"); PlayerInfo[playerid][pVMuted] = strval(savingstring);
mysql_fetch_field_row(savingstring, "jailed"); PlayerInfo[playerid][pJailed] = strval(savingstring);
mysql_fetch_field_row(savingstring, "jailtime"); PlayerInfo[playerid][pJailTime] = strval(savingstring);
mysql_fetch_field_row(savingstring, "toggedvipchat"); PlayerInfo[playerid][pToggedVIPChat] = strval(savingstring);
mysql_fetch_field_row(savingstring, "housekey"); PlayerInfo[playerid][pHousekey] = strval(savingstring);
mysql_fetch_field_row(savingstring, "warns"); PlayerInfo[playerid][pWarns] = strval(savingstring);
mysql_fetch_field_row(savingstring, "posx"); PlayerInfo[playerid][pPos_x] = strval(savingstring);
mysql_fetch_field_row(savingstring, "posy"); PlayerInfo[playerid][pPos_y] = strval(savingstring);
mysql_fetch_field_row(savingstring, "posz"); PlayerInfo[playerid][pPos_z] = strval(savingstring);
mysql_fetch_field_row(savingstring, "posa"); PlayerInfo[playerid][pPos_a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "health"); PlayerInfo[playerid][pHealth] = strval(savingstring);
mysql_fetch_field_row(savingstring, "armor"); PlayerInfo[playerid][pArmor] = strval(savingstring);
mysql_fetch_field_row(savingstring, "materials"); PlayerInfo[playerid][pMaterials] = strval(savingstring);
mysql_fetch_field_row(savingstring, "cocaine"); PlayerInfo[playerid][pCocaine] = strval(savingstring);
mysql_fetch_field_row(savingstring, "packages"); PlayerInfo[playerid][pPackages] = strval(savingstring);
mysql_fetch_field_row(savingstring, "interior"); PlayerInfo[playerid][pINT] = strval(savingstring);
mysql_fetch_field_row(savingstring, "virtualworld"); PlayerInfo[playerid][pVW] = strval(savingstring);
mysql_fetch_field_row(savingstring, "dice"); PlayerInfo[playerid][pDice] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon1"); PlayerInfo[playerid][pWeapon1] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon1a"); PlayerInfo[playerid][pWeapon1a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon2"); PlayerInfo[playerid][pWeapon2] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon2a"); PlayerInfo[playerid][pWeapon2a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon3"); PlayerInfo[playerid][pWeapon3] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon3a"); PlayerInfo[playerid][pWeapon3a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon4"); PlayerInfo[playerid][pWeapon4] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon4a"); PlayerInfo[playerid][pWeapon4a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon5"); PlayerInfo[playerid][pWeapon5] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon5a"); PlayerInfo[playerid][pWeapon5a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon6"); PlayerInfo[playerid][pWeapon6] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon6a"); PlayerInfo[playerid][pWeapon6a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon7"); PlayerInfo[playerid][pWeapon7] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon7a"); PlayerInfo[playerid][pWeapon7a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon8"); PlayerInfo[playerid][pWeapon8] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon8a"); PlayerInfo[playerid][pWeapon8a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon9"); PlayerInfo[playerid][pWeapon9] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon9a"); PlayerInfo[playerid][pWeapon9a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon10"); PlayerInfo[playerid][pWeapon10] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon10a"); PlayerInfo[playerid][pWeapon10a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon11"); PlayerInfo[playerid][pWeapon11] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon11a"); PlayerInfo[playerid][pWeapon11a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon12"); PlayerInfo[playerid][pWeapon12] = strval(savingstring);
mysql_fetch_field_row(savingstring, "weapon12a"); PlayerInfo[playerid][pWeapon12a] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog0"); PlayerInfo[playerid][pKillLog0] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog1"); PlayerInfo[playerid][pKillLog1] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog2"); PlayerInfo[playerid][pKillLog2] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog3"); PlayerInfo[playerid][pKillLog3] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog4"); PlayerInfo[playerid][pKillLog4] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog5"); PlayerInfo[playerid][pKillLog5] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog6"); PlayerInfo[playerid][pKillLog6] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog7"); PlayerInfo[playerid][pKillLog7] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog8"); PlayerInfo[playerid][pKillLog8] = strval(savingstring);
mysql_fetch_field_row(savingstring, "killlog9"); PlayerInfo[playerid][pKillLog9] = strval(savingstring);
mysql_fetch_field_row(savingstring, "deaths"); PlayerInfo[playerid][pDeaths] = strval(savingstring);
mysql_fetch_field_row(savingstring, "faction"); PlayerInfo[playerid][pFaction] = strval(savingstring);
mysql_fetch_field_row(savingstring, "rank"); PlayerInfo[playerid][pRank] = strval(savingstring);
mysql_fetch_field_row(savingstring, "leader"); PlayerInfo[playerid][pLeader] = strval(savingstring);
mysql_fetch_field_row(savingstring, "duty"); PlayerInfo[playerid][pDuty] = strval(savingstring);
mysql_fetch_field_row(savingstring, "crimes"); PlayerInfo[playerid][pCrimes] = strval(savingstring);
mysql_fetch_field_row(savingstring, "wantedlevel"); PlayerInfo[playerid][pWantedLevel] = strval(savingstring);
mysql_fetch_field_row(savingstring, "radio"); PlayerInfo[playerid][pRadio] = strval(savingstring);
mysql_fetch_field_row(savingstring, "radiofreq"); PlayerInfo[playerid][pRadioFreq] = strval(savingstring);
mysql_fetch_field_row(savingstring, "spam"); PlayerInfo[playerid][pSpam] = strval(savingstring);
mysql_fetch_field_row(savingstring, "dashboard"); PlayerInfo[playerid][pDashboard] = strval(savingstring);
}
mysql_free_result();
JustLogged[playerid] = 1;
Logged[playerid] = 1;
PlayerInfo[playerid][pLogins]++;
SendMessage(playerid, "~g~Info: ~w~You have been logged-in!");
return 1;
}