SA-MP Forums Archive
MYSQL Bussiness errors/warnings - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL Bussiness errors/warnings (/showthread.php?tid=387553)



MYSQL Bussiness errors/warnings - McFellow - 25.10.2012

Hello,
I get this warnings/errors with compiling and I don't know how to fix them
Код:
(20386) : warning 202: number of arguments does not match definition
(20397) : warning 202: number of arguments does not match definition
(20397) : warning 202: number of arguments does not match definition
(20397) : warning 202: number of arguments does not match definition
(20406) : warning 202: number of arguments does not match definition
(20406) : warning 202: number of arguments does not match definition
(20406) : warning 202: number of arguments does not match definition
(20458) : warning 202: number of arguments does not match definition
(20458) : warning 202: number of arguments does not match definition
(20458) : warning 202: number of arguments does not match definition
(20466) : error 035: argument type mismatch (argument 1)
(20477) : warning 202: number of arguments does not match definition
(20477) : warning 202: number of arguments does not match definition
(20477) : warning 202: number of arguments does not match definition
(20613) : error 035: argument type mismatch (argument 1)
This are the lines
PHP код:
stock UpdateBusinessOwner(BizIDBizOwner[])
{
    new 
query[150];
    
format(querysizeof(query), "UPDATE businessdata SET Owner='%s' WHERE BusinessID=%i"BizOwnerbInfo[BizID][ID]);
    
mysql_format(); // 20386
    
UpdateBusiness(BizID);
    return 
1;
}
stock UpdateBusiness(BizID)
{
    new 
query[300], string[128];
    
format(querysizeof(query), "UPDATE businessdata SET Price=%i, EnterX=%f, EnterY=%f, EnterZ=%f, ExitX=%f, ExitY=%f, ExitZ=%f, Interior=%i, World=%i, "bInfo[BizID][Price], bInfo[BizID][EnterX], bInfo[BizID][EnterY], bInfo[BizID][EnterZ], bInfo[BizID][ExitX], bInfo[BizID][ExitY], bInfo[BizID][ExitZ], bInfo[BizID][Interior], bInfo[BizID][World]);
    
format(stringsizeof(string), "Text='%s', Owner='%s', Minutes=%i, Money=%i WHERE BusinessID=%i"bInfo[BizID][Text], bInfo[BizID][Owner], bInfo[BizID][Minutes], bInfo[BizID][Money], bInfo[BizID][ID]);
    
strcat(querystring);
    
mysql_format(); // 20397
    
ReloadBusinesses();
    return 
1;
}
stock CreateBusiness(BizIDBizPriceBizEnterXBizEnterYBizEnterZBizExitXBizExitYBizExitZBizInteriorBizWorldBizText[])
{
    new 
query[300];
    
format(querysizeof(query), "INSERT INTO businessdata (BusinessID, Price, EnterX, EnterY, EnterZ, ExitX, ExitY, ExitZ, Interior, World, Text, Owner, Minutes, Money) VALUES(%i, %i, %f, %f, %f, %f, %f, %f, %i, %i, '%s', 'None', 0, 0)"BizIDBizPriceBizEnterXBizEnterYBizEnterZBizExitXBizExitYBizExitZBizInteriorBizWorldBizText);
    
mysql_format(); // 20406
    
ReloadBusinesses();
    return 
1;
}
stock ReloadBusinesses()
{
    for(new 
0MAX_BUSINESSESi++)
    {
        
DestroyDynamic3DTextLabel(bInfo[i][Label]);
        
DestroyDynamicPickup(bInfo[i][Pickup]);
    }
    
LoadBusinesses();
    return 
1;
}
stock LoadBusinesses()
{
    for(new 
0MAX_BUSINESSESi++)
    {
         new 
query[600], savingstring[24], string[128];
        
mysql_function_query(MainPipeline"SELECT * FROM `Business`"true"OnLoadBusiness""");
        while(
mysql_fetch_row_format(query,"|"))
        {
            
mysql_fetch_field_row(savingstring"BusinessID"); bInfo[i][ID] = strval(savingstring);
            
mysql_fetch_field_row(savingstring"Price"); bInfo[i][Price] = strval(savingstring);
            
mysql_fetch_field_row(savingstring"EnterX"); bInfo[i][EnterX] = floatstr(savingstring);
            
mysql_fetch_field_row(savingstring"EnterY"); bInfo[i][EnterY] = floatstr(savingstring);
            
mysql_fetch_field_row(savingstring"EnterZ"); bInfo[i][EnterZ] = floatstr(savingstring);
            
mysql_fetch_field_row(savingstring"ExitX"); bInfo[i][ExitX] = floatstr(savingstring);
            
mysql_fetch_field_row(savingstring"ExitY"); bInfo[i][ExitY] = floatstr(savingstring);
            
mysql_fetch_field_row(savingstring"ExitZ"); bInfo[i][ExitZ] = floatstr(savingstring);
    
mysql_fetch_field_row(savingstring"Interior"); bInfo[i][Interior] = strval(savingstring);
    
mysql_fetch_field_row(savingstring"World"); bInfo[i][World] = strval(savingstring);
    
mysql_fetch_field_row(savingstring"Text"); bInfo[i][Text] = savingstring;
    
mysql_fetch_field_row(savingstring"Owner"); bInfo[i][Owner] = savingstring;
    
mysql_fetch_field_row(savingstring"Minutes"); bInfo[i][Minutes] = strval(savingstring);
    
mysql_fetch_field_row(savingstring"Money"); bInfo[i][Money] = strval(savingstring);
    }
        new 
BizName[24]; format(BizName24"%s"bInfo[i][Text]);
        
printf(BizName'_'' ');
        if(!
strcmp(bInfo[i][Owner], "None"false)) format(stringsizeof(string), "%s [Unowned]\nPrice: %i\nType /enter or push f to enter the building"BizNamebInfo[i][Price]);
        else 
format(stringsizeof(string), "%s [Owner]: %s\nType /enter or push f to enter the building"bInfo[i][Text], bInfo[i][Owner]);
        
bInfo[i][Label] = CreateDynamic3DTextLabel(stringCOLOR_YELLOWbInfo[i][EnterX],bInfo[i][EnterY], bInfo[i][EnterZ], 12INVALID_PLAYER_IDINVALID_VEHICLE_ID1, -1, -1, -1);
        
bInfo[i][Pickup] = CreateDynamicPickup(12721bInfo[i][EnterX], bInfo[i][EnterY], bInfo[i][EnterZ], 0);
        if(
IsBusinessOwned(i)) printf("Business ID %i has loaded;  Named: %s"ibInfo[i][Text]);
    }
    return 
1;
}
stock DeleteBusiness(businessid)
{
    new 
query[100];
    
format(querysizeof(query), "DELETE FROM businessdata WHERE BusinessID = %i"businessid);
    
mysql_format(); // 20458
    
ReloadBusinesses();
    return 
1;
}
stock IsBusinessCreated(businessid)
{
    new 
query[200];
    
format(querysizeof(query), "SELECT * FROM `businessdata` WHERE BusinessID = %i"businessid);
    
mysql_function_query(query); // 20466
    
mysql_store_result();
    new 
rows mysql_num_rows();
    
mysql_free_result();
    if(!
rows) return false;
    else return 
true;
}
stock IsBusinessOwned(businessid)
{
    new 
query[200];
    
format(querysizeof(query), "SELECT Owner FROM 'businessdata' WHERE BusinessID = %i"businessid);
    
mysql_format(); // 20477
    
mysql_store_result();
    new 
rows mysql_num_rows();
    
mysql_free_result();
    if(!
rows) return false;
    else return 
true;
}
((
This is OnGameModeInit() ))
    
mysql_function_query("CREATE TABLE IF NOT EXISTS businessdata(BusinessID INT(3), Price Int(10), EnterX FLOAT(20), EnterY FLOAT(20), EnterZ FLOAT(20), ExitX FLOAT(20), ExitY FLOAT(20), ExitZ FLOAT(20), Interior INT(2), World INT(4), Text VARCHAR(24), Owner VARCHAR(24), Minutes INT(2), Money INT(5) )"); 



Re : MYSQL Bussiness errors/warnings - lelemaster - 25.10.2012

Take a look at this, you are missing things in your mysql_format

https://sampwiki.blast.hk/wiki/MySQL#mysql_format


Re: MYSQL Bussiness errors/warnings - McFellow - 25.10.2012

thanks


Re: MYSQL Bussiness errors/warnings - McFellow - 25.10.2012

Sorry but I still don't get it what I did wrong 0_o


Re: MYSQL Bussiness errors/warnings - CmZxC - 25.10.2012

Quote:
Originally Posted by McFellow
Посмотреть сообщение
Sorry but I still don't get it what I did wrong 0_o
Your parameters are empty.

go look again at https://sampwiki.blast.hk/wiki/MySQL#mysql_format and read the parameters part.


Re: MYSQL Bussiness errors/warnings - McFellow - 25.10.2012

I mean I don't get the parameter part


Re: MYSQL Bussiness errors/warnings - McFellow - 25.10.2012

Some one? :S (sorry for double posting)


Re: MYSQL Bussiness errors/warnings - McFellow - 25.10.2012

Some one please hep