Problem ORM [+rep]
#1

Hi,
My ORM does not work, it does not load yet nothing all looks good ... Thank you.

PHP код:
new _query[128];
mysql_format(connectSQL_querysizeof(_query), "SELECT * FROM `account` WHERE `Name` = '%e'"returnName(playerid));
mysql_tquery(connectSQL_query"OnPlayerDataLoad""d"playerid);
public 
OnPlayerDataLoad(playerid)
{
        
    if(
cache_num_rows() == 1)
    {
           new 
ORM:ormid pInfo[playerid][pORM_ID] = orm_create("account");
        
orm_addvar_int(ormidpInfo[playerid][pID], "ID");
        
orm_addvar_int(ormidpInfo[playerid][pAdmin], "AdminLevel");
        
orm_addvar_int(ormidpInfo[playerid][pLevel], "Level");
        
orm_addvar_int(ormidpInfo[playerid][pRespect], "Respect");
        
orm_addvar_int(ormidpInfo[playerid][pBank], "Bank");
        
orm_addvar_int(ormidpInfo[playerid][pSex], "Sex");
        
orm_addvar_int(ormidpInfo[playerid][pOrigin], "Origin");
        
orm_addvar_int(ormidpInfo[playerid][pSkin], "Skin");
        
orm_addvar_int(ormidpInfo[playerid][pBanTime], "BanTime");
        
        
orm_addvar_string(ormidpInfo[playerid][pPassword], 248"Password");
        
orm_addvar_string(ormidpInfo[playerid][pName], MAX_PLAYER_NAME+1"Name");
        
orm_addvar_string(ormidpInfo[playerid][pEmail], 248"Email");
        
orm_addvar_string(ormidpInfo[playerid][pDescription], 248"Description");
        
orm_addvar_string(ormidpInfo[playerid][pBanReason], 248"BanReason");
        
orm_setkey(ormid"Name");
        
dialogShow(playeridconnectPlayerDIALOG_STYLE_PASSWORD"{0197D8}Connexion а votre compte""{FEFEFE}Salut ! Merci d'entrer ton mot de passe dans la case ci-dessous, vous avez le droit а un maximum de 5 essais, sinon vous aurez un bannissement de 5 heures sans possibilitй d'unban manuellement.""Connexion""Dйconnexion");
    }
    
orm_setkey(pInfo[playerid][pORM_ID], "ID");
    return 
true;
}[
B][/B
Reply
#2

mysql_log eat?
Reply
#3

Код:
[22:07:36] [WARNING] cache_get_row_count - no active cache
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Name")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("AdminLevel")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Level")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Respect")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Bank")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Sex")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Origin")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Skin")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("BanTime")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Password")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Email")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Description")
[22:13:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("BanReason")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Name")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("AdminLevel")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Level")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Respect")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Bank")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Sex")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Origin")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Skin")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("BanTime")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Password")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Email")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Description")
[22:15:39] [WARNING] CMySQLResult::GetRowDataByName - field not found ("BanReason")
Yet these fields exist.
Reply
#4

Quote:

forward LoginCallback(playerid);

new nickname[MAX_PLAYER_NAME];
GetPlayerName(playerid,nickname, MAX_PLAYER_NAME);
new query_m[128];
mysql_format(DBHandle, query_m, sizeof(query_m), "SELECT * FROM `account` WHERE `Name` = '%e'",nickname);
mysql_tquery(DBHandle, query_m, "LoginCallback","i", playerid);

example 1:
public LoginCallback(playerid)
{
new ORMrmid = PlayerInfo[playerid][ORM_ID] = orm_create("account");
orm_addvar_int(ormid, PlayerInfo[playerid][pMYSQLID], "ID");
orm_addvar_string(ormid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME, "Name");
orm_setkey(ormid, "Name");
orm_addvar_string(ormid, PlayerInfo[playerid][pPassword], 64, "Password");
orm_addvar_int(ormid, PlayerInfo[playerid][pSex], "Sex");
return 1;
}

example 2 :

public LoginCallback(playerid)
{
new ORMrmid = PlayerInfo[playerid][ORM_ID] = orm_create("account");
orm_addvar_int(ormid, PlayerInfo[playerid][pMYSQLID], "ID");
orm_addvar_string(ormid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME, "Name");
orm_setkey(ormid, "Name");
orm_addvar_string(ormid, PlayerInfo[playerid][pPassword], 64, "Password");
orm_addvar_int(ormid, PlayerInfo[playerid][pSex], "Sex");
//
orm_apply_cache(ormid, 0);
return 1;
}

Maybe it will help you
Reply
#5

no load :/

PHP код:
           new ORM:ormid pInfo[playerid][pORM_ID] = orm_create("account");
           
        
orm_addvar_string(ormidpInfo[playerid][pName], MAX_PLAYER_NAME+1"Name");
        
orm_setkey(ormid"Name");
        
orm_addvar_string(ormidpInfo[playerid][pPassword], 248"Password");
        
orm_addvar_string(ormidpInfo[playerid][pName], MAX_PLAYER_NAME+1"Name");
        
orm_addvar_string(ormidpInfo[playerid][pEmail], 248"Email");
        
orm_addvar_string(ormidpInfo[playerid][pDescription], 248"Description");
        
orm_addvar_string(ormidpInfo[playerid][pBanReason], 248"BanReason");

        
orm_addvar_int(ormidpInfo[playerid][pID], "ID");
        
orm_addvar_int(ormidpInfo[playerid][pAdmin], "AdminLevel");
        
orm_addvar_int(ormidpInfo[playerid][pLevel], "Level");
        
orm_addvar_int(ormidpInfo[playerid][pRespect], "Respect");
        
orm_addvar_int(ormidpInfo[playerid][pBank], "Bank");
        
orm_addvar_int(ormidpInfo[playerid][pSex], "Sex");
        
orm_addvar_int(ormidpInfo[playerid][pOrigin], "Origin");
        
orm_addvar_int(ormidpInfo[playerid][pSkin], "Skin");
        
orm_addvar_int(ormidpInfo[playerid][pBanTime], "BanTime");
        
orm_apply_cache(ormid0); 
Reply
#6

You have no tables or cells
Reply
#7

Reply
#8

Do not re-created orm_addvar_string, orm_addvar_int

(SELECT `add the values that you want to read or create sequences from ID`)

EXAMPLE 1

SELECT `ID`, `Nickname`, `Password` ....

Example 2

SELECT * - Load all




mysql_format(DBHandle, query_m, sizeof(query_m), "SELECT * FROM `account` WHERE `Name` = '%e'",nickname);
mysql_tquery(DBHandle, query_m, "LoginCallback","i", playerid);
Reply
#9

and check the connection to mysql
Reply
#10

I did not understand sorry: / The connection is not good if it will launch.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)