Mysql Loading Help ! [+rep]
#1

Okay , i have tried too many things but there is a proplem with the loading the data saves in the mysql but it doesnt load here is the codes am using

PHP код:
stock LoadATMS()
{
    
printf("[LoadAtms] Loading data from database...");
    
mysql_function_query(MainPipeline"SELECT * FROM `atms`"true"OnLoadAtms""");

and

PHP код:
forward OnLoadATMS();
public 
OnLoadATMS()
{
    new 
irowsfieldstmp[128];
    
cache_get_data(rowsfieldsMainPipeline);
    while(
rows)
    {
        
cache_get_field_content(i"VW"tmpMainPipeline); ATM[i][atmVW] = strval(tmp);
        
cache_get_field_content(i"Int"tmpMainPipeline); ATM[i][atmInt] = strval(tmp);
        
cache_get_field_content(i"Modelz"tmpMainPipeline); ATM[i][atmModelz] = strval(tmp);
        
cache_get_field_content(i"PosX"tmpMainPipeline); ATM[i][atmPosX] = floatstr(tmp);
        
cache_get_field_content(i"PosY"tmpMainPipeline); ATM[i][atmPosY] = floatstr(tmp);
        
cache_get_field_content(i"PosZ"tmpMainPipeline); ATM[i][atmPosZ] = floatstr(tmp);
        
cache_get_field_content(i"Angle"tmpMainPipeline); ATM[i][atmAngle] = floatstr(tmp);
        
RenderATM(i);
        
i++;
    }
    if(
0printf("[LoadATMS] %d atms rehashed/loaded."i);
    else 
printf("[LoadATMS] Failed to load any atms.");

If somone can please fix me both by changing them to Yini or atleast help me to fix this bug it doesnt load.

Here the save codes.
PHP код:
stock SaveATM(id)
{
    new 
string[512];
    
format(stringsizeof(string), "UPDATE `atms` SET \
        `VW`=%d, \
        `Int`=%d, \
        `Modelz`=%d, \
        `PosX`=%f, \
        `PosY`=%f, \
        `PosZ`=%f, \
        `Angle`=%f WHERE `id`=%d"
,
        
ATM[id][atmVW],
        
ATM[id][atmInt],
        
ATM[id][atmModelz],
        
ATM[id][atmPosX],
        
ATM[id][atmPosY],
        
ATM[id][atmPosZ],
        
ATM[id][atmAngle],
        
id+1
    
); // Array starts from zero, MySQL starts at 1 (this is why we are adding one).
    
mysql_function_query(MainPipelinestringfalse"OnQueryFinish""i"SENDDATA_THREAD);

Reply


Messages In This Thread
Mysql Loading Help ! [+rep] - by MoemenWalid - 12.03.2015, 23:02
Re: Mysql Loading Help ! [+rep] - by FOTIS6 - 12.03.2015, 23:21
Re: Mysql Loading Help ! [+rep] - by TakeiT - 12.03.2015, 23:26
Re: Mysql Loading Help ! [+rep] - by MoemenWalid - 13.03.2015, 08:16

Forum Jump:


Users browsing this thread: 1 Guest(s)