mysql_tquery Tag Mismatch
#1

Code
PHP код:
CMD:adddealer(playerid,params[]){
    new 
Float:x,Float:y,Float:z,dname[32],m[512];
    if(
sscanf(params"s[32]"dname)) return SendClientMessage(playeridCOLOR_GREY"Usage:{FFFFFF} /adddealer [Name]");
    
GetPlayerPos(playeridx,y,z);
    for(new 
i=1;i<MAX_DEALERSHIP;i++){
        if(!
DealerInfo[i][dealer_id]){
            
DealerInfo[i][dealer_id]=i;
            
DealerInfo[i][dealer_pos][0] = x;
            
DealerInfo[i][dealer_pos][1] = y;
            
DealerInfo[i][dealer_pos][2] = z;
            
DealerInfo[i][dealer_pickup] = CreateDynamicPickup(131823x,y,z);
            
            
format(DealerInfo[i][dealer_name], 32"%s"dname);
            
mysql_format(dbhandlemsizeof(m), "INSERT INTO dealerships (x,y,z,name) VALUES ('%f','%f','%f','%s')"DealerInfo[i][dealer_pos][0],DealerInfo[i][dealer_pos][1],DealerInfo[i][dealer_pos][2],DealerInfo[i][dealer_name]);
            new 
Cache:result mysql_function_query(dbhandle,m,false,"","");
            
DealerInfo[i][dealer_sqlid]=cache_insert_id();
            
cache_delete(result);
            
format(msizeof(m), "You have successfully created dealership id %i [SQLID : %i]"DealerInfo[i][dealer_id],DealerInfo[i][dealer_sqlid]);
            
SendClientMessage(playeridCOLOR_GREENm);
            return 
1;
        }
    }
    return 
1;

Error Line
PHP код:
mysql_format(dbhandlemsizeof(m), "INSERT INTO dealerships (x,y,z,name) VALUES ('%f','%f','%f','%s')"DealerInfo[i][dealer_pos][0],DealerInfo[i][dealer_pos][1],DealerInfo[i][dealer_pos][2],DealerInfo[i][dealer_name]);
            new 
Cache:result mysql_function_query(dbhandle,m,false,"","");
            
DealerInfo[i][dealer_sqlid]=cache_insert_id(); 
Also not getting insert_id();
Reply
#2

The mysql_tquery execute the query in other thread and call a specified callback where return the result
What you looking for is mysql_query
Reply
#3

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
The mysql_tquery execute the query in other thread and call a specified callback where return the result
What you looking for is mysql_query
Sorry wrong code pasted, i tried with this
PHP код:
mysql_format(dbhandlemsizeof(m), "INSERT INTO dealerships (x,y,z,name) VALUES ('%f','%f','%f','%s')"DealerInfo[i][dealer_pos][0],DealerInfo[i][dealer_pos][1],DealerInfo[i][dealer_pos][2],DealerInfo[i][dealer_name]);
            new 
Cache:result mysql_tquery(dbhandlem); 
and got error

I tried with pquery tquery both
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)