31.03.2014, 01:04
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:
This is placed at at OnPlayerConnect
This is the function DoesAccountExist
- I am using the most recent version (R3 of the script
- The plugin matches the include
- The column "pName" exists in the MySQL database
[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 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;
}
- The plugin matches the include
- The column "pName" exists in the MySQL database