MySQL no load [REP+]
#1

Hello,

Today I have a problem I explain:
My load is not executes if id 1 is not present, and even if eg id 1 and present but is followed by the id 20, so the id 20 is not going to charge this but only id 1.

Код:
	SA-MP MySQL plugin R5
	Copyright © 2008-2010, G-sTyLeZzZ
Here is my code:
pawn Код:
public Shop_load()
{
    new Requete[504], fields[57][MAX_PLAYER_NAME], row[320];

    format(Requete, sizeof(Requete), "SELECT COUNT(*) FROM shop");
    mysql_query(Requete);
    mysql_store_result();
    mysql_fetch_row(row);
    Total_shop = strval(row);
    mysql_free_result();

    for(new i=1; i<=Total_shop; i++)
    {
        format(Requete, sizeof(Requete), "SELECT * FROM shop WHERE id=%d", i);
        mysql_query(Requete);
        mysql_store_result();
        mysql_fetch_row(row);
        split(row, fields, '|');

        Shop_infos[i][shopX] = floatstr(fields[1]); printf(">   %f      !shopX", Shop_infos[i][shopX]);
        Shop_infos[i][shopY] = floatstr(fields[2]);
        Shop_infos[i][shopZ] = floatstr(fields[3]);
        Shop_infos[i][shopXexit] = floatstr(fields[4]);
        Shop_infos[i][shopYexit] = floatstr(fields[5]);
        Shop_infos[i][shopZexit] = floatstr(fields[6]);
        Shop_infos[i][shopCaisse] = strval(fields[7]);
        Shop_infos[i][shopInterieur] = strval(fields[8]);
        Shop_infos[i][shopLock] = strval(fields[9]);

        mysql_free_result();
    }
    printf(">   %d shop load        !", Total_shop);
    return 1;
}
Sincerely,
Drek.
Reply
#2

Why you don't uupdate it to the lastest version ? R39, R5 is too old and (Maybe) nobody want to answer this.
Reply
#3

Because I prefer this version, and I'll see later if I want to change the version ..
Then this version works very well, nothing is missing .. I really like it when I code with me.
Reply
#4

Up !!!!!!!!!!!
Reply
#5

Up !!!!
Reply
#6

It is an outdated version of MySQL which could actually create this issue for you. Upgrade to the latest version to get support
Reply
#7

SA-MP MySQL plugin R5 is too old dude, Change your MySQL to the SA-MP MySQL plugin R39 Or R38
Reply
#8

It's not about the fucking version of mysql plugin...

I am not sure, if i understood your problem, but try this.
PHP код:
public Shop_load()
{
    new 
Requete[504], fields[57][MAX_PLAYER_NAME], row[320];
    
format(Requetesizeof(Requete), "SELECT COUNT(*) FROM shop");
    
mysql_query(Requete);
    
mysql_store_result();
    
mysql_fetch_row(row);
    
Total_shop strval(row);
    
mysql_free_result();
    for(new 
i=1i<=Total_shopi++)
    {
        
format(Requetesizeof(Requete), "SELECT * FROM shop LIMIT %d,%d"i-1,i);
        
mysql_query(Requete);
        
mysql_store_result();
        
mysql_fetch_row(row);
        
split(rowfields'|');
                new 
id strval(fields[0]);
 
        
Shop_infos[id][shopX] = floatstr(fields[1]); printf(">    %f         !shopX"Shop_infos[id][shopX]);
        
Shop_infos[id][shopY] = floatstr(fields[2]);
        
Shop_infos[id][shopZ] = floatstr(fields[3]);
        
Shop_infos[id][shopXexit] = floatstr(fields[4]);
        
Shop_infos[id][shopYexit] = floatstr(fields[5]);
        
Shop_infos[id][shopZexit] = floatstr(fields[6]);
        
Shop_infos[id][shopCaisse] = strval(fields[7]);
        
Shop_infos[id][shopInterieur] = strval(fields[8]);
        
Shop_infos[id][shopLock] = strval(fields[9]);
        
mysql_free_result();
    }
    
printf(">    %d shop load        !"Total_shop);
    return 
1;

Reply
#9

But to upgrade to this version , his ask me too much time, and on top of that I do not know anything about the R39 verison , so its take me too much time , so if someone is available to give me a call hand for this version.
Reply
#10

The code does not work, a little up , please
But maybe its not coming charging, but the INSERT, so here is the code

pawn Код:
public Plante_update(i)
{
    new Requete[1024], result[LITTLE_STRING], Requetes[1024];
   
    format(Requetes, sizeof(Requetes), "SELECT COUNT(*) FROM therp_plantes");
    mysql_query(Requetes);

    mysql_store_result();
    mysql_fetch_row(result);

    i = strval(result) + 1;
    mysql_free_result();
   
    format(Requete, sizeof(Requete),"INSERT INTO therp_plantes SET `Type`='%d', `Variete`='%d', `Sexe`='%d', `Recolte`='%d', `Temps`='%d', `X`='%f', `Y`='%f', `Z`='%f'",

    Plante_infos[i][Plante_type],
    Plante_infos[i][Plante_variete],
    Plante_infos[i][Plante_sexe],
    Plante_infos[i][Plante_recolte],
    Plante_infos[i][Plante_temps],
    Plante_infos[i][Plante_X],
    Plante_infos[i][Plante_Y],
    Plante_infos[i][Plante_Z]);

    mysql_query(Requete);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)