Unknown problem with mysql.so
#1

Hello, I am using StrickenKid 2.1.1's MySQL, and whenever I use it on my Linux host, provided by Volt-Host, I can connect to the MySQL server and all, but then I use the MySQL Function 'mysql_fetch_field()' and it will crash. This is crazy though, as it works just fine on my normal computer, which is Windows. I have tried many things to fix this, and nothing has helped.

CrashDetect;
Код:
[23:18:46] [debug] #2  0000afd8 in ShowLoginScreen () from NA-RP.amx
[23:18:46] [debug] #1  0000d830 in ?? () from NA-RP.amx
[23:18:46] [debug] #0  ???????? in native mysql_fetch_field () from mysql.so
[23:18:46] [debug] Backtrace (most recent call first):
[23:18:46] [debug] Server crashed while executing NA-RP.amx
[/code]

ShowLoginScreen removes the Welcome Textdraws, then it checks if the name of the account is found in our mysql db.
I have a variable 'MySQLCheckAcc', and it will do the query, but then when I try to use mysql_fetch_field(), to get the ID of the account, I guess it crashes.


ShowLoginScreen();
pawn Код:
PUB:ShowLoginScreen(playerid) {
    new string[256];
    TextDrawHideForPlayer(playerid, WelcomeTD[0]);
    TextDrawHideForPlayer(playerid, WelcomeTD[1]);
    TextDrawHideForPlayer(playerid, WelcomeTD[2]);
    if(!MySQLCheckAcc(GPN(playerid))) {
        format(string, 256, "Welcome to New Archon RP, %s.\nThis account is {FF0000}not{A9C4E4} registered.\nEnter the password you wish for your account to have.", GPN(playerid));
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "NA-RP: Registration", string, "Confirm", "Exit");
        return 1;
    }
    format(string, 256, "Welcome back to New Archon RP, %s.\nThis account {00FF00}is{A9C4E4} registered.\nEnter the password to your account.", GPN(playerid));
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "NA-RP: Login", string, "Confirm", "Exit");
    return 1;
}
MySQLCheckAcc();
pawn Код:
stock MySQLCheckAcc(params[]) {
    new query[128], id[8];
    mysql_real_escape_string(params, params);
    format(query, 128, "SELECT `ID` FROM `Accounts` WHERE `Username` = '%s' LIMIT 1;", params);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows()) { mysql_fetch_field("ID", id); }
    else { id = "0"; }
    mysql_free_result();
    return strval(id);
}
Reply
#2

What I mean to say, I connect, it shows me the welcome textdraw, it then removes it, and then right after that, MySQLCheckAcc is called and the server crashes.
Reply
#3

bump
Reply
#4

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)