DIALOG_STYLE_LIST Dynamische Listitems

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
  • Ich habe schon mehrere Stichworte in die SuFu eingegeben, komme aber nicht an mein Ziel.
    Ich möchte die Anzahl der Einträge aus der MySQL Datenbank auslesen und sie in einen Dialog wiedergeben
    (DIALOY_STYLE_LIST). Wenn ich 4 Einträge habe sollen auch die 4 In der Liste erscheinen, habe ich 6 sollen 6 stk erscheinen.



    In bedanke mich für jede Hilfe, die mir weiterhilft :thumbup:


    MFG
    EllBundy

  • Ungefähr so:


    Irgendwo rufst du ja deine Query auf:

    mysql_tquery(handle,"SELECT * FROM `example`", "OnQueryLoaded", "d", playerid);


    Dann erstellst du die Funktion:

    forward OnQueryLoaded(playerid);
    public OnQueryLoaded(playerid)
    {
    new rows;
    cache_get_row_count(rows);
    new dialogstr[4096],addstr[256];
    for(new i; i<rows; i++)
    {
    //irgendwelche Sachen halt auslesen (wichtig: i und nicht 0 verwenden)
    format(addstr, sizeof(addstr),"%s test %d mit %f", test1, test2, test3);
    strcat(dialogstr, addstr);
    }
    ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_LIST, "Dynamischer Listendialog", dialogstr, "Auswählen", "Schliessen");
    return 1;
    }

  • Hey danke für deine Antwort, aber bleibe nun bei meinem Letzten erstell Dialog stehen !


    Response Dialog:
    case DIALOG_ADMINHAUSC2:
    {
    if(!response){ return ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC2, DIALOG_STYLE_INPUT, str, "Gebe nun den Betrag ein:", "Weiter", "Zurück"); }
    switch(HausCreate[playerid][chKaufart])
    {
    case 1:
    {
    if(strval(inputtext) > 250){ HausCreate[playerid][chKaufpreis] = strval(inputtext); CreateHouse(playerid, 2); }
    else{ return ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC2, DIALOG_STYLE_INPUT, "Haussystem -> Kaufart -> Coins", "Gebe nun den Betrag ein:\nDer Betrag muss höher als 250 Coins sein !", "Weiter", "Zurück");}
    }
    case 2:
    {
    if(strval(inputtext) > 500000){ HausCreate[playerid][chKaufpreis] = strval(inputtext); CreateHouse(playerid, 2); }
    else{ return ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC2, DIALOG_STYLE_INPUT, "Haussystem -> Kaufart -> SA$", "Gebe nun den Betrag ein:\nDer Betrag muss höher als 500000 Coins sein !", "Weiter", "Zurück");}
    } // Bis hier hin wird alles ausgeführt !!!
    }
    mysql_pquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);
    }


    GetInteriorList:
    public GetInteriorList(playerid)
    {
    new rows;
    cache_get_row_count(rows);
    new dialogstr[4096],addstr[32],intname[32];
    for(new i; i<rows; i++)
    {
    cache_get_value_name_int(i, "ID", HausCreate[playerid][chIntID]);
    cache_get_value_name(i, "name", intname);
    format(addstr, sizeof(addstr),"[%d]%s\n",HausCreate[playerid][chIntID], intname);
    strcat(dialogstr, addstr);
    }
    ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC3, DIALOG_STYLE_LIST, "Haussystem -> Interior", dialogstr, "Weiter", "Zurück");
    return 1;
    }


    Eine weitere Frage !
    Wie kann ich die ID übermitteln, damit ich bei dem listitem die richtige ID bekomme ?

  • Du könntest so machen, dass du einfach statt DIALOG_STYLE_LIST einfach DIALOG_STYLE_TABLIST verwendest.
    Dann musst du nur Zeile 10 zu dem ändern:

    format(addstr, sizeof(addstr),"%d\t%s\n",HausCreate[playerid][chIntID], intname);

    Und Zeile 13:

    ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC3, DIALOG_STYLE_TABLIST, "Haussystem -> Interior", dialogstr, "Weiter", "Zurück");


    Dann kannst du beim OnDialogResponse einfach inputtext verwenden.
    Inputtext ist dann die ID des Hauses als String.

  • Werde ich so abändern, aber zum Testen müsste ich den Dialog angezeigt bekommen, was ja erstmal mein Hauptproblem ist.


    mysql_tquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);


    mysql_pquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);


    Beide Varianten funktionieren nicht. Der letzte Dialog wird ausgeführt, aber die Interiorliste erscheint nicht.

  • mysql_tquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);


    Diese benutzt du in einem Query für strings. ( ' ' )
    Wenn du die Tabellennamen etc escapen willst verwende Backticks ( `` )


    Also so

    mysql_tquery(handle,"SELECT * FROM `interior` WHERE art = 'haus'", "GetInteriorList", "d", playerid);

  • log_ core.txt
    [20:43:53] [INFO] received Windows console close event; shutting log-core down


    warnings.txt
    [20:41:25] [plugins/mysql] mysql_connect: no password specified // Ist glaube ich weil ich kein passwort habe


    Habe nun folgende Anfragen ausprobiert, aber die TABLIST erscheint immer noch nicht


    tquery
    mysql_tquery(handle,"SELECT * FROM `interior` WHERE `art` = 'haus'", "GetInteriorList", "d", playerid);


    mysql_tquery(handle,"SELECT * FROM `interior` WHERE art = 'haus'", "GetInteriorList", "d", playerid);


    pquery
    mysql_pquery(handle,"SELECT * FROM `interior` WHERE `art` = 'haus'", "GetInteriorList", "d", playerid);
    mysql_pquery(handle,"SELECT * FROM `interior` WHERE art = 'haus'", "GetInteriorList", "d", playerid);



    Das kann doch nicht so schwer sein :huh:?(

  • [20:15:31] [WARNING] mysql_connect: no password specified
    [20:16:27] [ERROR] error #1054 while executing query "INSERT INTO user (name, password) VALUES ('Ellbundy', MD5('Steven90'))": Unknown column 'password' in 'field list'
    [20:16:39] [ERROR] error #1054 while executing query "INSERT INTO user (name, password) VALUES ('Ellbundy', MD5('steven90'))": Unknown column 'password' in 'field list'
    [20:18:31] [WARNING] mysql_connect: no password specified
    [20:24:59] [WARNING] mysql_connect: no password specified
    [20:25:44] [WARNING] mysql_connect: no password specified
    [20:30:46] [WARNING] mysql_connect: no password specified
    [20:57:32] [WARNING] mysql_connect: no password specified
    [22:09:35] [WARNING] mysql_connect: no password specified
    [22:17:14] [WARNING] mysql_connect: no password specified
    [22:19:41] [WARNING] mysql_connect: no password specified
    [22:23:55] [WARNING] mysql_connect: no password specified
    [18:01:05] [WARNING] mysql_connect: no password specified
    [18:06:01] [WARNING] mysql_connect: no password specified
    [16:05:48] [WARNING] mysql_connect: no password specified
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [WARNING] mysql_connect: no password specified
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [WARNING] mysql_connect: no password specified
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:12:04] [WARNING] mysql_connect: no password specified
    [16:12:04] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:12:04] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:12:04] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:12:05] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:12:05] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    [16:27:26] [WARNING] mysql_connect: no password specified
    [19:41:06] [WARNING] mysql_connect: no password specified
    [19:42:33] [ERROR] error #1064 while executing query "SELECT name FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    [19:42:57] [ERROR] error #1064 while executing query "SELECT name FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    [19:45:45] [WARNING] mysql_connect: no password specified
    [19:47:42] [ERROR] error #1064 while executing query "SELECT * FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    [19:48:55] [WARNING] mysql_connect: no password specified
    [19:50:12] [ERROR] error #1064 while executing query "SELECT * FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    [20:05:02] [WARNING] mysql_connect: no password specified
    [20:05:11] [WARNING] mysql_connect: no password specified
    [20:14:56] [WARNING] mysql_connect: no password specified
    [20:22:36] [WARNING] mysql_connect: no password specified
    [20:23:12] [ERROR] error #1054 while executing query "SELECT * FROM `interior` WHERE art = `haus`": Unknown column 'haus' in 'where clause'
    [20:24:07] [WARNING] mysql_connect: no password specified
    [20:24:58] [WARNING] mysql_connect: no password specified
    [20:25:38] [ERROR] error #1054 while executing query "SELECT * FROM `interior` WHERE art = `haus`": Unknown column 'haus' in 'where clause'
    [20:41:25] [WARNING] mysql_connect: no password specified
    [20:44:06] [WARNING] mysql_connect: no password specified
    [20:47:29] [WARNING] mysql_connect: no password specified
    [20:48:53] [WARNING] mysql_connect: no password specified
    [20:57:06] [WARNING] mysql_connect: no password specified

  • gewöhn dir mal die backticks an und verwende die richtig!

    SQL
    SELECT * FROM 'interior' WHERE art = 'haus'



    Das ist Falsch!

    SQL
    SELECT * FROM `interior` WHERE `art` = 'haus';

    So sollte es aussehen


    SQL
    INSERT INTO user (name, password) VALUES ('Ellbundy', MD5('Steven90'))

    Nutz auch hier backticks

    SQL
    INSERT INTO `user` (`name`, `password`) VALUES ('Ellbundy', MD5('Steven90'));


    Aber mach mal ein Passwort in den Datenbanknutzer rein

    All in all it's just another brick in the wall

  • public GetInteriorList(playerid)
    {
    printf("Test2");
    new rows;
    cache_get_row_count(rows);
    printf("rows: %d", rows);
    new dialogstr[4096],addstr[32],intname[32],intid;
    for(new i = 0; i != rows; i++)
    {
    cache_get_value_name_int(i, "ID", intid);
    cache_get_value_name(i, "name", intname);
    format(addstr, sizeof(addstr),"%d\t%s\n",intid, intname);
    strcat(dialogstr, addstr);
    mysql_log();
    printf("Test3");
    }
    ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC3, DIALOG_STYLE_TABLIST, "Haussystem -> Interior", dialogstr, "Weiter", "Abbrechen");
    printf("Test4");
    return 1;
    }


    Also habe nun testprint´s eingefügt, "Test2" und die Row anzahl werden korrekt angezeigt !
    "Test 3" und "Test 4" werden nicht ausgegeben

  • nimm mal den debug aus der schleife raus
    bin mir fast sicher dass der daran schuld ist


    Aber zum testen mach mal nen print davor
    also so


    (Will mal wissen ob er bis dahin kommt
    wenn ja dann nimm den log da weg

    All in all it's just another brick in the wall

  • SA-MP Dedicated Server
    ----------------------
    v0.3.7-R2, (C)2005-2015 SA-MP Team


    [22:00:52] filterscripts = "" (string)
    [22:00:52]
    [22:00:52] Server Plugins
    [22:00:52] --------------
    [22:00:52] Loading plugin: mysql
    [22:00:52] >> plugin.mysql: R41-4 successfully loaded.
    [22:00:52] Loaded.
    [22:00:52] Loaded 1 plugins.


    [22:00:52]
    [22:00:52] Filterscripts
    [22:00:52] ---------------
    [22:00:52] Loaded 0 filterscripts.


    [22:00:52]
    --------------------------------------
    [22:00:52] Reallife Gamemode by EllBundy
    [22:00:52] --------------------------------------


    [22:00:52] [MySQL] Verbindungsaufbau...
    [22:00:52] [MySQL] Die Verbindung zur Datenbank wurde erfolgreich hergestellt! Handle: 1
    [22:00:52] Script[gamemodes/Reallife.amx]: Run time error 20: "Invalid index parameter (bad entry point)"
    [22:00:52] Number of vehicle models: 0
    [22:00:52] LOAD: Haus[1] | X[0.000000] | Y[0.000000] | Z[0.000000] | Int[3]
    [22:00:52] LOAD: Haus[2] | X[0.000000] | Y[0.000000] | Z[0.000000] | Int[2]
    [22:00:52] LOAD: Haus[3] | X[0.000000] | Y[0.000000] | Z[0.000000] | Int[2]
    [22:00:52] LOAD: Haus[4] | X[1105.630004] | Y[-311.832000] | Z[73.985099] | Int[2]
    [22:00:52] LOAD: Haus[5] | X[1102.530029] | Y[-311.401000] | Z[73.992202] | Int[0]
    [22:00:52] [HAUSSYSTEM] Es wurden 5 Häuser geladen.
    [22:01:14] [connection] 127.0.0.1:62393 requests connection cookie.
    [22:01:15] [connection] incoming connection: 127.0.0.1:62393 id: 0
    [22:01:15] [join] Ellbundy has joined the server (0:127.0.0.1)
    [22:01:30] Test
    [22:01:30] Test2
    [22:01:30] rows: 2

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen