Argument type mismatch (argument 1) when getting info from MySQL database
#1


Hey, the code there
pawn Код:
new admin_name[25], prz[60], data[20], s[200], s1[2000], tipas;
                    while(mysql_retrieve_row(1))
                    {
                        mysql_get_field("admin_name", admin_name);
                        mysql_get_field("prz", prz);
                        mysql_get_field("data", data);
                        mysql_get_field("tipas", tipas); // error line! I tried to delete it and then everything went good, but when I wrote it again, it gives me an error again! :((
                        if(tipas == 1) {format(s, 2000, "{FFFFFF}[{B36666}ban{FFFFFF}](%s) {15FF0F}ADM: %s {FF8000}(%s)\n", data, admin_name, prz);}
                        else if(tipas == 0) {format(s, 2000, "{FFFFFF}[{B36666}kick{FFFFFF}](%s) {15FF0F}ADM: %s {FF8000}(%s)\n", data, admin_name, prz);}
                        strcat(s1, s);
                    }
What should I do?
Reply
#2

The 2nd argument is wrong. It should be an array/string but you used an integer. Store it to a temporary string and then use strval and store the output to "tipas".
Reply
#3

Ok, now with this everything's fine. But now it returns me errors in if and else if statements, that array must be indexed, what now?
Reply
#4

Thanks bro!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)