SetVariableAsKey - variable not found
#1

I'm using BlueG's MySQL plugin (R3 and I am using ORM for queries. At a specific part of my script I receive these error messages:

[02:54:12] [ERROR] COrm::SetVariableAsKey - variable not found
[02:54:12] [ERROR] COrm::GenerateSelectQuery - invalid key or connection handle

This is the part of the script:
pawn Код:
new ORM:ormid = PlayerInfo[playerid][ORM_ID] = orm_create("Players");
   
    orm_setkey(ormid, "pName");
    orm_select(ormid, "DoesAccountExist", "s", playerid);
This is placed at at OnPlayerConnect


This is the function DoesAccountExist
pawn Код:
forward DoesAccountExist(playerid);
public DoesAccountExist(playerid)
{
    print("in function");
    switch(orm_errno(PlayerInfo[playerid][ORM_ID]))
    {
        case ERROR_OK: {
            ShowPlayerDialog(playerid, DIALOG_REGISTER_1, DIALOG_STYLE_PASSWORD, "Log In", "blabla.", "Log in", "Cancel");
            print("1");
        }
        case ERROR_NO_DATA: {
            ShowPlayerDialog(playerid, DIALOG_REGISTER_1, DIALOG_STYLE_PASSWORD, "Register", "blabla.", "Register", "Abort");
            print("2");
        }
    }
    print("switch done");
    orm_setkey(PlayerInfo[playerid][ORM_ID], "ID");
    return 1;
}
- I am using the most recent version (R3 of the script
- The plugin matches the include
- The column "pName" exists in the MySQL database
Reply
#2

pawn Код:
orm_select(ormid, "DoesAccountExist", "d", playerid);
Should be "d" not "s"
Reply
#3

I had that fixed already, still doesn't work..
Reply
#4

I've tried several things in an attempt to fix it.. I renamed the variable name (also in the database), it did not work.

Also I tried if the connection was working correctly and it did... I can't seem to find a solution.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)