MySQL Help - Syntax Error
#1

This is my error:

Код:
[12:24:32] [ERROR] CMySQLQuery::Execute[CreateNewVeh] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
This is my code:
PHP код:
AddVehicleToDB(playeridmodelcolor1color2Float:xFloat:yFloat:zFloat:ateamtype)
{
    new 
idx FreevIndex();
    if(
idx == -1) return 0;
    
mysql_format(mysqldquerysizeof(dquery), "INSERT INTO `vehicles` (model, color1, color2, posx, posy, posz, posa, team, type) VALUES ('%s', %d, %d, %d, %f, %f, %f, %f, %d, %d)"modelcolor1color2xyzateamtype);
    
mysql_tquery(mysqldquery"CreateNewVeh""iiiffffiiii"modelcolor1color2xyzaidxplayeridteamtype);
    return 
1;

PHP код:
PF:CreateNewVeh(modelcolor1color2Float:xFloat:yFloat:zFloat:aidxplayeridteamtype)
{
    
Vehicle[idx][ID] = cache_insert_id();
    
Vehicle[idx][Model] = model;
    
Vehicle[idx][Color1] = color1;
    
Vehicle[idx][Color2] = color2;
    
Vehicle[idx][PosX] = x;
    
Vehicle[idx][PosY] = y;
    
Vehicle[idx][PosZ] = z;
    
Vehicle[idx][PosA] = a;
    
Vehicle[idx][Type] = type;
    
Vehicle[idx][Team] = team;
    
Vehicle[idx][Created] = false;
    
vCreateIndex(idx);
    if(
IsPlayerConnected(playerid))
    {
        
SCM(playeridCOL_WHITE" >> Vehicle successfully created. ");
    }
    
SetVehicleParamsEx(Vehicle[idx][ID],VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
    
PutPlayerInVehicle(playeridVehicle[idx][ID], 0);
    return 
1;

Reply
#2

Your specifier list doesn't match up with your value list. You have 10 specifiers but only 9 values.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Your specifier list doesn't match up with your value list. You have 10 specifiers but only 9 values.
Wow, rookie mistake.
You're the real MVP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)