error 033: array must be indexed (variable "-unknown-")

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • public CreateTabels() { new query[1000]; query = "CREATE TABLE IF NOT EXISTS Clients (id INT NOT NULL AUTO_INCREMENT,name VARCHAR(25),pKey VARCHAR(128),pLevel INT,pAdmin INT,pDonateRank INT,gPupgrade INT,pConnectTime INT,pReg INT,pSex INT,pAge INT,pOrigin INT,pCK INT,pMuted INT,pExp INT,pCash INT,pAccount INT,pCrimes INT,pKills INT,pDeaths INT,pArrested INT," + "pWantedDeaths INT,pPhoneBook INT,pLottoNr INT,pFishes INT,pJob INT,PPayCheck INT,pHeadValue INT,pJailed INT,pJailTime INT,pMats INT,pDrugs INT,pLeader INT,pMember INT,pFMember INT,pRank INT,pChar INT,pContractTime INT,pDetSkill INT,pSexSkill INT,pBoxSkill INT,pLawSkill INT,pMechSkill INT,pJackSkill INT,pCarSkill INT,pNewsSkill INT," + "pDrugsSkill INT,pCookSkill INT,pFishSkill INT,pHealth FLOAT,pSHealth FLOAT,pInt INT,pLocal INT,pTeam INT,pModel INT,pPnumber INT,pPhousekey INT,pPbiskey INT,pPos_x FLOAT,pPos_y FLOAT,pPos_z FLOAT,pCarLic INT,pNewLic INT,pFlyLic INT,pBoatLic INT,pFishLic INT,pGunLic INT,pLKWLic INT,pMotoLic INT,pZig INT,pZigSucht INT,pGun1 INT,pGun2 INT," + "pGun3 INT,pGun4 INT,pAmmo1 INT,pAmmo2 INT,pAmmo3 INT,pAmmo4 INT,pCarTime INT,pPayDay INT,pPayDayHad INT,pCDPlayer INT,pWins INT,pLoses INT,pAlcoholPerk INT,pDrugPerk INT,pMiserPerk INT,pPainPerk INT,pTraderPerk INT,pTut INT,pWarns INT,pAdjustable INT,pFuel INT,pMarried INT,pMarriedTo VARCHAR(128),pRoadblock INT,pPlayMinutes INT," + "pGesamtMinutes INT,pMinutesSinceLogin INT,pMinutesSinceAn INT,pSFPASS INT,pLVPASS INT,pHandyGeld INT,pHandyVer INT,pUhrID INT,pHandyID INT,pTot INT," + "pTx FLOAT,pTy FLOAT,pTz FLOAT,pOwnPerso INT,pOwnAntrag INT,pPersoStop INT,pFrakSperre INT,PRIMARY KEY (id))"; mysql_tquery(SQLHandel,query);}


    (12584 -- 12586) : error 033: array must be indexed (variable "-unknown-")
    (12584 -- 12589) : error 033: array must be indexed (variable "-unknown-")


    Der Große Query String gibt mir die Errors aus.Kann mir da jemand Helfen ?


    Danke im Vorraus.

  • (12583) : error 075: input line too long (after substitutions)
    (12584) : error 037: invalid string (possibly non-terminated string)
    (12584) : error 017: undefined symbol "CREATE"
    (12584) : error 017: undefined symbol "TABLE"
    (12584) : fatal error 107: too many error messages on one line


    format(query, sizeof(query), "CREATE TABLE IF NOT EXISTS Clients (id INT NOT NULL AUTO_INCREMENT,name VARCHAR(25),pKey VARCHAR(128),pLevel INT,pAdmin INT,pDonateRank INT,gPupgrade INT,pConnectTime INT,pReg INT,pSex INT,pAge INT,pOrigin INT,pCK INT,pMuted INT,pExp INT,pCash INT,pAccount INT,pCrimes INT,pKills INT,pDeaths INT,pArrested INT,pWantedDeaths INT,pPhoneBook INT,pLottoNr INT,pFishes INT,pJob INT,PPayCheck INT,pHeadValue INT,pJailed INT,pJailTime INT,pMats INT,pDrugs INT,pLeader INT,pMember INT,pFMember INT,pRank INT,pChar INT,pContractTime INT,pDetSkill INT,pSexSkill INT,pBoxSkill INT,pLawSkill INT,pMechSkill INT,pJackSkill INT,pCarSkill INT,pNewsSkill INT,pDrugsSkill INT,pCookSkill INT,pFishSkill INT,pHealth FLOAT,pSHealth FLOAT,pInt INT,pLocal INT,pTeam INT,pModel INT,pPnumber INT,pPhousekey INT,pPbiskey INT,pPos_x FLOAT,pPos_y FLOAT,pPos_z FLOAT,pCarLic INT,pNewLic INT,pFlyLic INT,pBoatLic INT,pFishLic INT,pGunLic INT,pLKWLic INT,pMotoLic INT,pZig INT,pZigSucht INT,pGun1 INT,pGun2 INT,pGun3 INT,pGun4 INT,pAmmo1 INT,pAmmo2 INT,pAmmo3 INT,pAmmo4 INT,pCarTime INT,pPayDay INT,pPayDayHad INT,pCDPlayer INT,pWins INT,pLoses INT,pAlcoholPerk INT,pDrugPerk INT,pMiserPerk INT,pPainPerk INT,pTraderPerk INT,pTut INT,pWarns INT,pAdjustable INT,pFuel INT,pMarried INT,pMarriedTo VARCHAR(128),pRoadblock INT,pPlayMinutes INT,pGesamtMinutes INT,pMinutesSinceLogin INT,pMinutesSinceAn INT,pSFPASS INT,pLVPASS INT,pHandyGeld INT,pHandyVer INT,pUhrID INT,pHandyID INT,pTot INT,pTx FLOAT,pTy FLOAT,pTz FLOAT,pOwnPerso INT,pOwnAntrag INT,pPersoStop INT,pFrakSperre INT,PRIMARY KEY (id))");

  • Um es trotz dass es schon gelöst ist kurz zu erklären:
    Die Zeile ist zu lang, daher muss sie geteilt werden. Mit format würde man es so machen:
    format(query, sizeof(query), "CREATE TABLE IF NOT EXISTS Clients (id INT NOT NULL AUTO_INCREMENT,name VARCHAR(25),pKey VARCHAR(128),pLevel INT,pAdmin INT,pDonateRank INT,gPupgrade INT,");
    format(query, sizeof(query), "%spConnectTime INT,pReg INT,pSex INT,pAge INT,pOrigin INT,pCK INT,pMuted INT,pExp INT,pCash INT,pAccount INT,pCrimes INT,pKills INT,pDeaths INT,pArrested INT,pWantedDeaths INT,pPhoneBook INT,", query);
    format(query, sizeof(query), "%spLottoNr INT,pFishes INT,pJob INT,PPayCheck INT,pHeadValue INT,pJailed INT,pJailTime INT,pMats INT,pDrugs INT,pLeader INT,pMember INT,pFMember INT,pRank INT,pChar INT,pContractTime INT,pDetSkill INT,", query);
    format(query, sizeof(query), "%spSexSkill INT,pBoxSkill INT,pLawSkill INT,pMechSkill INT,pJackSkill INT,pCarSkill INT,pNewsSkill INT,pDrugsSkill INT,pCookSkill INT,pFishSkill INT,pHealth FLOAT,pSHealth FLOAT,pInt INT,pLocal INT,", query);
    format(query, sizeof(query), "%spTeam INT,pModel INT,pPnumber INT,pPhousekey INT,pPbiskey INT,pPos_x FLOAT,pPos_y FLOAT,pPos_z FLOAT,pCarLic INT,pNewLic INT,pFlyLic INT,pBoatLic INT,pFishLic INT,pGunLic INT,pLKWLic INT,pMotoLic INT,", query);
    format(query, sizeof(query), "%spZig INT,pZigSucht INT,pGun1 INT,pGun2 INT,pGun3 INT,pGun4 INT,pAmmo1 INT,pAmmo2 INT,pAmmo3 INT,pAmmo4 INT,pCarTime INT,pPayDay INT,pPayDayHad INT,pCDPlayer INT,pWins INT,pLoses INT,pAlcoholPerk INT,", query);
    format(query, sizeof(query), "%spDrugPerk INT,pMiserPerk INT,pPainPerk INT,pTraderPerk INT,pTut INT,pWarns INT,pAdjustable INT,pFuel INT,pMarried INT,pMarriedTo VARCHAR(128),pRoadblock INT,pPlayMinutes INT,pGesamtMinutes INT,", query);
    format(query, sizeof(query), "%spMinutesSinceLogin INT,pMinutesSinceAn INT,pSFPASS INT,pLVPASS INT,pHandyGeld INT,pHandyVer INT,pUhrID INT,pHandyID INT,pTot INT,pTx FLOAT,pTy FLOAT,pTz FLOAT,pOwnPerso INT,pOwnAntrag INT,", query);
    format(query, sizeof(query), "%spPersoStop INT,pFrakSperre INT,PRIMARY KEY (id))", query);

  • @Jeffry geht leichter ^^


    format(query, sizeof(query), "%s%s%s%s%s%s%s%s%s%s",
    "CREATE TABLE IF NOT EXISTS Clients (id INT NOT NULL AUTO_INCREMENT,name VARCHAR(25),pKey VARCHAR(128),pLevel INT,",
    "pAdmin INT,pDonateRank INT,gPupgrade INT,pConnectTime INT,pReg INT,pSex INT,pAge INT,pOrigin INT,pCK INT,pMuted INT,",
    "pExp INT,pCash INT,pAccount INT,pCrimes INT,pKills INT,pDeaths INT,pArrested INT,pWantedDeaths INT,pPhoneBook INT,",
    "pLottoNr INT,pFishes INT,pJob INT,PPayCheck INT,pHeadValue INT,pJailed INT,pJailTime INT,pMats INT,pDrugs INT,",
    "pLeader INT,pMember INT,pFMember INT,pRank INT,pChar INT,pContractTime INT,pDetSkill INT,pSexSkill INT,pBoxSkill INT,",
    "pLawSkill INT,pMechSkill INT,pJackSkill INT,pCarSkill INT,pNewsSkill INT,pDrugsSkill INT,pCookSkill INT,pFishSkill INT,",
    "pHealth FLOAT,pSHealth FLOAT,pInt INT,pLocal INT,pTeam INT,pModel INT,pPnumber INT,pPhousekey INT,pPbiskey INT,",
    "pPos_x FLOAT,pPos_y FLOAT,pPos_z FLOAT,pCarLic INT,pNewLic INT,pFlyLic INT,pBoatLic INT,pFishLic INT,pGunLic INT,",
    "pLKWLic INT,pMotoLic INT,pZig INT,pZigSucht INT,pGun1 INT,pGun2 INT,pGun3 INT,pGun4 INT,pAmmo1 INT,pAmmo2 INT,pAmmo3 INT,pAmmo4 INT,pCarTime INT,pPayDay INT,pPayDayHad INT,pCDPlayer INT,pWins INT,",
    "pLoses INT,pAlcoholPerk INT,pDrugPerk INT,pMiserPerk INT,pPainPerk INT,pTraderPerk INT,pTut INT,pWarns INT,pAdjustable INT,pFuel INT,pMarried INT,pMarriedTo VARCHAR(128),pRoadblock INT,pPlayMinutes INT,pGesamtMinutes INT,pMinutesSinceLogin INT,pMinutesSinceAn INT,pSFPASS INT,pLVPASS INT,pHandyGeld INT,pHandyVer INT,pUhrID INT,pHandyID INT,pTot INT,pTx FLOAT,pTy FLOAT,pTz FLOAT,pOwnPerso INT,pOwnAntrag INT,pPersoStop INT,pFrakSperre INT,PRIMARY KEY (id))");

  • Nein, geht es nicht. Denn der Compiler wird beim compilieren die Zeile, die du da hast, in eine zusammen fassen, bei Jeffry wären das mehrere Zeilen.
    Bei deiner Methode wäre die Zeile dann immer noch zu lang.

  • @Jeffry geht leichter

    Interessante Methode, habe ich so noch nie gesehen, aber geht natürlich. Wem das lieber ist, warum nicht. :)
    Ich finde es ne tolle Variante, aber etwas unübersichtlicher, das ist aber wahrscheinlich nur die Gewohnheit.


    Nein, geht es nicht.

    Doch, so geht es auch, da man nach dem Komma einen Umbruch machen kann, und es dann nicht mehr zusammengefasst wird.
    Kann man mit den Parametern im Format ja auch machen, die Strings sind hier entsprechend diese Parameter.

  • Kann man mit den Parametern im Format ja auch machen, die Strings sind hier entsprechend diese Parameter.

    Stimmt, ist mir gar nicht aufgefallen. :fun: Ok, mal wieder was dazu gelernt. :D