Mysql problem
#1

Hey,
I'm stuck at creating in-game email system:
pawn Код:
if(dialogid == 26 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                SPD(playerid, 27, DIALOG_STYLE_INPUT, "E-Mail", "Irasykite PILNA gavejo varda\n(E-Mail'us galima siusti ir atsijungusiems zaidejams):", "Toliau", "Baigti");
            }
            case 1:
            {
                new query[255];
                format(query, sizeof(query), "SELECT * FROM emailai WHERE receiver_name = '%s'", PlayerName(playerid));
                mysql_query(1, query);
                mysql_store_result();
                new rows = mysql_num_rows();
                if(rows == 0) SPMB(playerid, "Neturi gautu zinuciu!");
                else
                {
                    new s[1000];
                    for(new i = 1; i <= rows; i++)
                    {
                        // here i want to loop through all stored rows and get fields, but how? :(((
                    }
                }
                mysql_free_result();
            }
            case 2:
            {
           
            }
        }
    }
+rep for helper
Reply
#2

I don't get it correctly, but if I'm correct try this:

pawn Код:
//add a string
new savingstring[20];

//At your comment
    else {

        while(mysql_fetch_row_format(query,"|"))
        {
            mysql_fetch_field_row(savingstring, "Your_saved_field_Name"); //Do your code
        }
    }
    mysql_free_result();

//For Example

mysql_fetch_field_row(savingstring, "scores"); SetPlayerScore(playerid, strval(savingstring));
(if I'm wrong, please mention)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)